diff --git a/custom_components/tapo/binary_sensor.py b/custom_components/tapo/binary_sensor.py index 4f353a9..9fdb234 100644 --- a/custom_components/tapo/binary_sensor.py +++ b/custom_components/tapo/binary_sensor.py @@ -29,6 +29,7 @@ class OverheatSensor(BaseTapoEntity[TapoCoordinator], BinarySensorEntity): def __init__(self, coordinator: TapoCoordinator): super().__init__(coordinator) self._attr_name = "Overheat" + self._attr_icon = "mdi:fire-alert" self._attr_entity_category = EntityCategory.DIAGNOSTIC @property diff --git a/custom_components/tapo/hub/binary_sensor.py b/custom_components/tapo/hub/binary_sensor.py index c3e10c0..ea535ef 100644 --- a/custom_components/tapo/hub/binary_sensor.py +++ b/custom_components/tapo/hub/binary_sensor.py @@ -33,10 +33,6 @@ class SmartDoorSensor(BaseTapoHubChildEntity, BinarySensorEntity): def __init__(self, coordinator: TapoCoordinator): super().__init__(coordinator) - @property - def unique_id(self): - return super().unique_id + "_" + self._attr_name.replace(" ", "_") - @property def device_class(self) -> Optional[str]: return BinarySensorDeviceClass.DOOR @@ -54,10 +50,6 @@ class MotionSensor(BaseTapoHubChildEntity, BinarySensorEntity): def __init__(self, coordinator: TapoCoordinator): super().__init__(coordinator) - @property - def unique_id(self): - return super().unique_id + "_" + self._attr_name.replace(" ", "_") - @property def device_class(self) -> Optional[str]: return BinarySensorDeviceClass.MOTION @@ -98,5 +90,5 @@ def is_on(self) -> bool: T31Device: [LowBatterySensor], T110SmartDoor: [SmartDoorSensor, LowBatterySensor], S200ButtonDevice: [LowBatterySensor], - T100MotionSensor: [LowBatterySensor], + T100MotionSensor: [MotionSensor, LowBatterySensor], } diff --git a/custom_components/tapo/hub/tapo_hub.py b/custom_components/tapo/hub/tapo_hub.py index ad708af..72921d4 100644 --- a/custom_components/tapo/hub/tapo_hub.py +++ b/custom_components/tapo/hub/tapo_hub.py @@ -21,6 +21,7 @@ from homeassistant.helpers.device_registry import DeviceRegistry from plugp100.api.hub.hub_device import HubDevice from plugp100.api.hub.s200b_device import S200ButtonDevice +from plugp100.api.hub.t100_device import T100MotionSensor from plugp100.api.hub.t110_device import T110SmartDoor from plugp100.api.hub.t31x_device import T31Device from plugp100.responses.device_state import DeviceInfo @@ -126,6 +127,8 @@ def _create_child_device(child_state: dict[str, Any], hub: HubDevice): return T110SmartDoor(hub, device_id) elif "s200" in model: return S200ButtonDevice(hub, device_id) + elif "t100" in model: + return T100MotionSensor(hub, device_id) return None