Route OpenClaw chat by HA user

This commit is contained in:
2026-05-06 08:08:18 +02:00
parent 90d525e842
commit 8221098ebc
12 changed files with 285 additions and 68 deletions
+5
View File
@@ -120,6 +120,7 @@ class OpenClawSensor(CoordinatorEntity[OpenClawCoordinator], SensorEntity):
"""Initialize the sensor."""
super().__init__(coordinator)
self.entity_description = description
self._entry = entry
self._attr_unique_id = f"{entry.entry_id}_{description.key}"
self._attr_device_info = {
"identifiers": {(DOMAIN, entry.entry_id)},
@@ -134,6 +135,10 @@ class OpenClawSensor(CoordinatorEntity[OpenClawCoordinator], SensorEntity):
"""Return the state of the sensor."""
if not self.coordinator.data:
return None
if self.entity_description.key == DATA_MODEL:
selected = self._entry.options.get("active_model")
if selected:
return selected
return self.coordinator.data.get(self.entity_description.key)
@property