custom_components/whatsapp_bridge_integration/sensor.py aktualisiert

0.2.2
This commit is contained in:
2026-06-15 09:37:06 +00:00
parent 3b99c037ae
commit 7175522f4a

View File

@@ -78,7 +78,7 @@ class WhatsAppAccountEntity(SensorEntity):
class WhatsAppBroadcastEntity(SensorEntity):
"""Virtual 'All Accounts' Entity (Global, keinem spezifischen Gerät zugeordnet)."""
"""Virtual 'All Accounts' Entity, geordnet unter dem zentralen Hub."""
def __init__(self):
self._attr_name = "WhatsApp Broadcast (All)"
self._attr_unique_id = "whatsapp_bridge_broadcast_all"
@@ -91,9 +91,16 @@ class WhatsAppBroadcastEntity(SensorEntity):
def state(self):
return "Global"
@property
def device_info(self) -> DeviceInfo:
"""Ordnet diese Entität dem zentralen Hub-Gerät zu."""
return DeviceInfo(
identifiers={(DOMAIN, "global_bridge_hub")},
)
class WhatsAppStatusSensor(SensorEntity):
"""Echter Live-Status-Sensor (Global, keinem spezifischen Gerät zugeordnet)."""
"""Echter Live-Status-Sensor, geordnet unter dem zentralen Hub."""
def __init__(self, coordinator):
self.coordinator = coordinator
@@ -136,6 +143,13 @@ class WhatsAppStatusSensor(SensorEntity):
}
return {}
@property
def device_info(self) -> DeviceInfo:
"""Ordnet diese Entität dem zentralen Hub-Gerät zu."""
return DeviceInfo(
identifiers={(DOMAIN, "global_bridge_hub")},
)
async def async_added_to_hass(self):
"""Registrieren beim Live-Coordinator."""
self.async_on_remove(