mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Add icon translations to Rainbird (#112200)
* Add icon translations to Rainbird * Add icon translations to Rainbird
This commit is contained in:
parent
f7ac3912ec
commit
d811125eb7
@ -21,7 +21,6 @@ _LOGGER = logging.getLogger(__name__)
|
||||
RAIN_SENSOR_ENTITY_DESCRIPTION = BinarySensorEntityDescription(
|
||||
key="rainsensor",
|
||||
translation_key="rainsensor",
|
||||
icon="mdi:water",
|
||||
)
|
||||
|
||||
|
||||
|
@ -49,7 +49,7 @@ class RainBirdCalendarEntity(
|
||||
|
||||
_attr_has_entity_name = True
|
||||
_attr_name: str | None = None
|
||||
_attr_icon = "mdi:sprinkler"
|
||||
_attr_translation_key = "calendar"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
28
homeassistant/components/rainbird/icons.json
Normal file
28
homeassistant/components/rainbird/icons.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"entity": {
|
||||
"binary_sensor": {
|
||||
"rainsensor": {
|
||||
"default": "mdi:water"
|
||||
}
|
||||
},
|
||||
"calendar": {
|
||||
"calendar": {
|
||||
"default": "mdi:sprinkler"
|
||||
}
|
||||
},
|
||||
"number": {
|
||||
"rain_delay": {
|
||||
"default": "mdi:water-off"
|
||||
}
|
||||
},
|
||||
"sensor": {
|
||||
"raindelay": {
|
||||
"default": "mdi:water-off"
|
||||
}
|
||||
}
|
||||
},
|
||||
"services": {
|
||||
"start_irrigation": "mdi:water",
|
||||
"set_rain_delay": "mdi:water-sync"
|
||||
}
|
||||
}
|
@ -41,7 +41,6 @@ class RainDelayNumber(CoordinatorEntity[RainbirdUpdateCoordinator], NumberEntity
|
||||
_attr_native_max_value = 14
|
||||
_attr_native_step = 1
|
||||
_attr_native_unit_of_measurement = UnitOfTime.DAYS
|
||||
_attr_icon = "mdi:water-off"
|
||||
_attr_translation_key = "rain_delay"
|
||||
_attr_has_entity_name = True
|
||||
|
||||
|
@ -19,7 +19,6 @@ _LOGGER = logging.getLogger(__name__)
|
||||
RAIN_DELAY_ENTITY_DESCRIPTION = SensorEntityDescription(
|
||||
key="raindelay",
|
||||
translation_key="raindelay",
|
||||
icon="mdi:water-off",
|
||||
)
|
||||
|
||||
|
||||
|
@ -53,7 +53,6 @@ async def test_rainsensor(
|
||||
assert rainsensor.state == expected_state
|
||||
assert rainsensor.attributes == {
|
||||
"friendly_name": "Rain Bird Controller Rainsensor",
|
||||
"icon": "mdi:water",
|
||||
}
|
||||
|
||||
|
||||
|
@ -204,7 +204,6 @@ async def test_event_state(
|
||||
"description": "",
|
||||
"location": "",
|
||||
"friendly_name": "Rain Bird Controller",
|
||||
"icon": "mdi:sprinkler",
|
||||
}
|
||||
assert state.state == expected_state
|
||||
|
||||
@ -248,7 +247,6 @@ async def test_no_schedule(
|
||||
assert state.state == "unavailable"
|
||||
assert state.attributes == {
|
||||
"friendly_name": "Rain Bird Controller",
|
||||
"icon": "mdi:sprinkler",
|
||||
}
|
||||
|
||||
client = await hass_client()
|
||||
@ -276,7 +274,6 @@ async def test_program_schedule_disabled(
|
||||
assert state.state == "off"
|
||||
assert state.attributes == {
|
||||
"friendly_name": "Rain Bird Controller",
|
||||
"icon": "mdi:sprinkler",
|
||||
}
|
||||
|
||||
|
||||
|
@ -57,7 +57,6 @@ async def test_number_values(
|
||||
assert raindelay.state == expected_state
|
||||
assert raindelay.attributes == {
|
||||
"friendly_name": "Rain Bird Controller Rain delay",
|
||||
"icon": "mdi:water-off",
|
||||
"min": 0,
|
||||
"max": 14,
|
||||
"mode": "auto",
|
||||
|
@ -51,7 +51,6 @@ async def test_sensors(
|
||||
assert raindelay.state == expected_state
|
||||
assert raindelay.attributes == {
|
||||
"friendly_name": "Rain Bird Controller Raindelay",
|
||||
"icon": "mdi:water-off",
|
||||
}
|
||||
|
||||
entity_entry = entity_registry.async_get("sensor.rain_bird_controller_raindelay")
|
||||
|
Loading…
x
Reference in New Issue
Block a user