entities correction
This commit is contained in:
@@ -75,37 +75,3 @@ class DiagnosticsSensor(SensorEntity):
|
||||
def should_poll(self) -> bool:
|
||||
""" Do not poll for those entities """
|
||||
return False
|
||||
|
||||
class TestVBEElapsedSecondEntity(SensorEntity):
|
||||
""" La classe de l'entité TestVBE_4 """
|
||||
|
||||
def __init__(self,
|
||||
hass: HomeAssistant, #pylint: disable=unused-argument
|
||||
entry_infos, #pylint: disable=unused-argument
|
||||
) -> None:
|
||||
""" Class constructor """
|
||||
self._attr_name = entry_infos.get("name")
|
||||
self._attr_unique_id = entry_infos.get("entity_id")
|
||||
self._attr_has_entity_name = True
|
||||
self._attr_native_value = 36
|
||||
|
||||
@property
|
||||
def icon(self) -> str | None:
|
||||
return "mdi:timer-play"
|
||||
|
||||
@property
|
||||
def device_class(self) -> SensorDeviceClass | None:
|
||||
return SensorDeviceClass.DURATION
|
||||
|
||||
@property
|
||||
def state_class(self) -> SensorStateClass | None:
|
||||
return SensorStateClass.MEASUREMENT
|
||||
|
||||
@property
|
||||
def native_unit_of_measurement(self) -> str | None:
|
||||
return UnitOfTime.SECONDS
|
||||
|
||||
@property
|
||||
def should_poll(self) -> bool:
|
||||
""" Do not poll for those entities """
|
||||
return False
|
||||
|
||||
@@ -37,12 +37,12 @@ class SystemStateSwitch(SwitchEntity):
|
||||
"""Select component to set system state """
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(self,
|
||||
def __init__(self,
|
||||
device: Koolnova,
|
||||
) -> None:
|
||||
super().__init__()
|
||||
self._device = device
|
||||
self._attr_name = f"{device.name} system state"
|
||||
self._attr_name = f"{device.name} System State"
|
||||
self._attr_device_info = device.device_info
|
||||
self._attr_unique_id = f"{DOMAIN}-SystemState-switch"
|
||||
_LOGGER.debug("[SYS STATE] State: {}".format(bool(int(self._device.sys_state))))
|
||||
@@ -62,13 +62,11 @@ class SystemStateSwitch(SwitchEntity):
|
||||
|
||||
def _update_state(self) -> None:
|
||||
""" update system state """
|
||||
_LOGGER.debug("[SYS STATE] _update_state")
|
||||
self._is_on = bool(int(self._device.sys_state))
|
||||
|
||||
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
||||
async def async_update(self):
|
||||
"""Retrieve latest state."""
|
||||
_LOGGER.debug("[SYS STATE] async_update")
|
||||
self._update_state()
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user