1 """Entities for the ViCare integration."""
3 from PyViCare.PyViCareDevice
import Device
as PyViCareDevice
4 from PyViCare.PyViCareDeviceConfig
import PyViCareDeviceConfig
5 from PyViCare.PyViCareHeatingDevice
import (
6 HeatingDeviceWithComponent
as PyViCareHeatingDeviceComponent,
12 from .const
import DOMAIN
16 """Base class for ViCare entities."""
18 _attr_has_entity_name =
True
22 unique_id_suffix: str,
23 device_serial: str |
None,
24 device_config: PyViCareDeviceConfig,
25 device: PyViCareDevice,
26 component: PyViCareHeatingDeviceComponent |
None =
None,
28 """Initialize the entity."""
29 gateway_serial = device_config.getConfig().serial
30 device_id = device_config.getId()
32 identifier = f
"{gateway_serial}_{device_serial.replace("zigbee-
", "zigbee_
") if device_serial is not None else device_id}"
34 self._api: PyViCareDevice | PyViCareHeatingDeviceComponent = (
35 component
if component
else device
42 identifiers={(DOMAIN, identifier)},
43 serial_number=device_serial,
44 name=device_config.getModel(),
45 manufacturer=
"Viessmann",
46 model=device_config.getModel(),
47 configuration_url=
"https://developer.viessmann.com/",
None __init__(self, str unique_id_suffix, str|None device_serial, PyViCareDeviceConfig device_config, PyViCareDevice device, PyViCareHeatingDeviceComponent|None component=None)