mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Add icon translations to Fireservicerota (#111537)
This commit is contained in:
parent
24050b6e0f
commit
1a61c6db1c
@ -49,23 +49,10 @@ class ResponseBinarySensor(CoordinatorEntity, BinarySensorEntity):
|
||||
self._client = client
|
||||
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
|
||||
def is_on(self) -> bool | None:
|
||||
"""Return the state of the binary sensor."""
|
||||
|
||||
self._state = self._client.on_duty
|
||||
|
||||
return self._state
|
||||
return self._client.on_duty
|
||||
|
||||
@property
|
||||
def extra_state_attributes(self) -> dict[str, Any]:
|
||||
|
12
homeassistant/components/fireservicerota/icons.json
Normal file
12
homeassistant/components/fireservicerota/icons.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"entity": {
|
||||
"binary_sensor": {
|
||||
"duty": {
|
||||
"default": "mdi:calendar-remove",
|
||||
"state": {
|
||||
"on": "mdi:calendar-check"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user