1 """Common entity for VeSync Component."""
5 from pyvesync.vesyncbasedevice
import VeSyncBaseDevice
10 from .const
import DOMAIN
14 """Base class for VeSync Entity Representations."""
16 _attr_has_entity_name =
True
18 def __init__(self, device: VeSyncBaseDevice) ->
None:
19 """Initialize the VeSync device."""
25 """Return the ID of this device."""
29 if isinstance(self.
devicedevice.sub_device_no, int):
30 return f
"{self.device.cid}{self.device.sub_device_no!s}"
31 return self.
devicedevice.cid
35 """Return True if device is available."""
36 return self.
devicedevice.connection_status ==
"online"
40 """Return device information."""
43 name=self.
devicedevice.device_name,
44 model=self.
devicedevice.device_type,
45 manufacturer=
"VeSync",
46 sw_version=self.
devicedevice.current_firm_version,
50 """Update vesync device."""
55 """Base class for VeSync Device Representations."""
59 """Provide access to the device details dictionary."""
60 return self.
devicedevice.details
64 """Return True if device is on."""
65 return self.
devicedevice.device_status ==
"on"
68 """Turn the device off."""
None __init__(self, VeSyncBaseDevice device)
DeviceInfo device_info(self)
None turn_off(self, **Any kwargs)