mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +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(
|
RAIN_SENSOR_ENTITY_DESCRIPTION = BinarySensorEntityDescription(
|
||||||
key="rainsensor",
|
key="rainsensor",
|
||||||
translation_key="rainsensor",
|
translation_key="rainsensor",
|
||||||
icon="mdi:water",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ class RainBirdCalendarEntity(
|
|||||||
|
|
||||||
_attr_has_entity_name = True
|
_attr_has_entity_name = True
|
||||||
_attr_name: str | None = None
|
_attr_name: str | None = None
|
||||||
_attr_icon = "mdi:sprinkler"
|
_attr_translation_key = "calendar"
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
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_max_value = 14
|
||||||
_attr_native_step = 1
|
_attr_native_step = 1
|
||||||
_attr_native_unit_of_measurement = UnitOfTime.DAYS
|
_attr_native_unit_of_measurement = UnitOfTime.DAYS
|
||||||
_attr_icon = "mdi:water-off"
|
|
||||||
_attr_translation_key = "rain_delay"
|
_attr_translation_key = "rain_delay"
|
||||||
_attr_has_entity_name = True
|
_attr_has_entity_name = True
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
RAIN_DELAY_ENTITY_DESCRIPTION = SensorEntityDescription(
|
RAIN_DELAY_ENTITY_DESCRIPTION = SensorEntityDescription(
|
||||||
key="raindelay",
|
key="raindelay",
|
||||||
translation_key="raindelay",
|
translation_key="raindelay",
|
||||||
icon="mdi:water-off",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,7 +53,6 @@ async def test_rainsensor(
|
|||||||
assert rainsensor.state == expected_state
|
assert rainsensor.state == expected_state
|
||||||
assert rainsensor.attributes == {
|
assert rainsensor.attributes == {
|
||||||
"friendly_name": "Rain Bird Controller Rainsensor",
|
"friendly_name": "Rain Bird Controller Rainsensor",
|
||||||
"icon": "mdi:water",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -204,7 +204,6 @@ async def test_event_state(
|
|||||||
"description": "",
|
"description": "",
|
||||||
"location": "",
|
"location": "",
|
||||||
"friendly_name": "Rain Bird Controller",
|
"friendly_name": "Rain Bird Controller",
|
||||||
"icon": "mdi:sprinkler",
|
|
||||||
}
|
}
|
||||||
assert state.state == expected_state
|
assert state.state == expected_state
|
||||||
|
|
||||||
@ -248,7 +247,6 @@ async def test_no_schedule(
|
|||||||
assert state.state == "unavailable"
|
assert state.state == "unavailable"
|
||||||
assert state.attributes == {
|
assert state.attributes == {
|
||||||
"friendly_name": "Rain Bird Controller",
|
"friendly_name": "Rain Bird Controller",
|
||||||
"icon": "mdi:sprinkler",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
client = await hass_client()
|
client = await hass_client()
|
||||||
@ -276,7 +274,6 @@ async def test_program_schedule_disabled(
|
|||||||
assert state.state == "off"
|
assert state.state == "off"
|
||||||
assert state.attributes == {
|
assert state.attributes == {
|
||||||
"friendly_name": "Rain Bird Controller",
|
"friendly_name": "Rain Bird Controller",
|
||||||
"icon": "mdi:sprinkler",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,7 +57,6 @@ async def test_number_values(
|
|||||||
assert raindelay.state == expected_state
|
assert raindelay.state == expected_state
|
||||||
assert raindelay.attributes == {
|
assert raindelay.attributes == {
|
||||||
"friendly_name": "Rain Bird Controller Rain delay",
|
"friendly_name": "Rain Bird Controller Rain delay",
|
||||||
"icon": "mdi:water-off",
|
|
||||||
"min": 0,
|
"min": 0,
|
||||||
"max": 14,
|
"max": 14,
|
||||||
"mode": "auto",
|
"mode": "auto",
|
||||||
|
@ -51,7 +51,6 @@ async def test_sensors(
|
|||||||
assert raindelay.state == expected_state
|
assert raindelay.state == expected_state
|
||||||
assert raindelay.attributes == {
|
assert raindelay.attributes == {
|
||||||
"friendly_name": "Rain Bird Controller Raindelay",
|
"friendly_name": "Rain Bird Controller Raindelay",
|
||||||
"icon": "mdi:water-off",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
entity_entry = entity_registry.async_get("sensor.rain_bird_controller_raindelay")
|
entity_entry = entity_registry.async_get("sensor.rain_bird_controller_raindelay")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user