Add icon translations to Fireservicerota (#111537)

This commit is contained in:
Joost Lekkerkerker 2024-02-28 08:50:57 +01:00 committed by GitHub
parent 24050b6e0f
commit 1a61c6db1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 14 deletions

View File

@ -49,23 +49,10 @@ class ResponseBinarySensor(CoordinatorEntity, BinarySensorEntity):
self._client = client self._client = client
self._attr_unique_id = f"{entry.unique_id}_Duty" self._attr_unique_id = f"{entry.unique_id}_Duty"
self._state: bool | None = None
@property
def icon(self) -> str:
"""Return the icon to use in the frontend."""
if self._state:
return "mdi:calendar-check"
return "mdi:calendar-remove"
@property @property
def is_on(self) -> bool | None: def is_on(self) -> bool | None:
"""Return the state of the binary sensor.""" """Return the state of the binary sensor."""
return self._client.on_duty
self._state = self._client.on_duty
return self._state
@property @property
def extra_state_attributes(self) -> dict[str, Any]: def extra_state_attributes(self) -> dict[str, Any]:

View File

@ -0,0 +1,12 @@
{
"entity": {
"binary_sensor": {
"duty": {
"default": "mdi:calendar-remove",
"state": {
"on": "mdi:calendar-check"
}
}
}
}
}