mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 19:57:07 +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._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]:
|
||||||
|
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