Route OpenClaw chat by HA user
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user