diff --git a/homeassistant/components/rainbird/binary_sensor.py b/homeassistant/components/rainbird/binary_sensor.py index ee5be0e4617..139a17f5181 100644 --- a/homeassistant/components/rainbird/binary_sensor.py +++ b/homeassistant/components/rainbird/binary_sensor.py @@ -20,7 +20,7 @@ _LOGGER = logging.getLogger(__name__) RAIN_SENSOR_ENTITY_DESCRIPTION = BinarySensorEntityDescription( key="rainsensor", - name="Rainsensor", + translation_key="rainsensor", icon="mdi:water", ) @@ -38,6 +38,8 @@ async def async_setup_entry( class RainBirdSensor(CoordinatorEntity[RainbirdUpdateCoordinator], BinarySensorEntity): """A sensor implementation for Rain Bird device.""" + _attr_has_entity_name = True + def __init__( self, coordinator: RainbirdUpdateCoordinator, diff --git a/homeassistant/components/rainbird/number.py b/homeassistant/components/rainbird/number.py index ac1ea961870..febb960d652 100644 --- a/homeassistant/components/rainbird/number.py +++ b/homeassistant/components/rainbird/number.py @@ -32,14 +32,14 @@ async def async_setup_entry( class RainDelayNumber(CoordinatorEntity[RainbirdUpdateCoordinator], NumberEntity): - """A number implemnetaiton for the rain delay.""" + """A number implementation for the rain delay.""" _attr_native_min_value = 0 _attr_native_max_value = 14 _attr_native_step = 1 _attr_native_unit_of_measurement = UnitOfTime.DAYS _attr_icon = "mdi:water-off" - _attr_name = "Rain delay" + _attr_translation_key = "rain_delay" _attr_has_entity_name = True def __init__( diff --git a/homeassistant/components/rainbird/sensor.py b/homeassistant/components/rainbird/sensor.py index de74943baf9..f5cf2390095 100644 --- a/homeassistant/components/rainbird/sensor.py +++ b/homeassistant/components/rainbird/sensor.py @@ -1,4 +1,4 @@ -"""Support for Rain Bird Irrigation system LNK WiFi Module.""" +"""Support for Rain Bird Irrigation system LNK Wi-Fi Module.""" from __future__ import annotations import logging @@ -18,7 +18,7 @@ _LOGGER = logging.getLogger(__name__) RAIN_DELAY_ENTITY_DESCRIPTION = SensorEntityDescription( key="raindelay", - name="Raindelay", + translation_key="raindelay", icon="mdi:water-off", ) @@ -42,6 +42,8 @@ async def async_setup_entry( class RainBirdSensor(CoordinatorEntity[RainbirdUpdateCoordinator], SensorEntity): """A sensor implementation for Rain Bird device.""" + _attr_has_entity_name = True + def __init__( self, coordinator: RainbirdUpdateCoordinator, diff --git a/homeassistant/components/rainbird/strings.json b/homeassistant/components/rainbird/strings.json index 3b5ae332dbd..a98baead976 100644 --- a/homeassistant/components/rainbird/strings.json +++ b/homeassistant/components/rainbird/strings.json @@ -27,5 +27,22 @@ } } } + }, + "entity": { + "binary_sensor": { + "rainsensor": { + "name": "Rainsensor" + } + }, + "number": { + "rain_delay": { + "name": "Rain delay" + } + }, + "sensor": { + "raindelay": { + "name": "Raindelay" + } + } } } diff --git a/homeassistant/components/rainbird/switch.py b/homeassistant/components/rainbird/switch.py index ceca9c71c36..3e2a3115e29 100644 --- a/homeassistant/components/rainbird/switch.py +++ b/homeassistant/components/rainbird/switch.py @@ -1,4 +1,4 @@ -"""Support for Rain Bird Irrigation system LNK WiFi Module.""" +"""Support for Rain Bird Irrigation system LNK Wi-Fi Module.""" from __future__ import annotations import logging diff --git a/tests/components/rainbird/test_binary_sensor.py b/tests/components/rainbird/test_binary_sensor.py index 816f2a3b969..cfa2c4d2684 100644 --- a/tests/components/rainbird/test_binary_sensor.py +++ b/tests/components/rainbird/test_binary_sensor.py @@ -31,10 +31,10 @@ async def test_rainsensor( assert await setup_integration() - rainsensor = hass.states.get("binary_sensor.rainsensor") + rainsensor = hass.states.get("binary_sensor.rain_bird_controller_rainsensor") assert rainsensor is not None assert rainsensor.state == expected_state assert rainsensor.attributes == { - "friendly_name": "Rainsensor", + "friendly_name": "Rain Bird Controller Rainsensor", "icon": "mdi:water", } diff --git a/tests/components/rainbird/test_sensor.py b/tests/components/rainbird/test_sensor.py index e9923b1a052..049a5f15c45 100644 --- a/tests/components/rainbird/test_sensor.py +++ b/tests/components/rainbird/test_sensor.py @@ -28,10 +28,10 @@ async def test_sensors( assert await setup_integration() - raindelay = hass.states.get("sensor.raindelay") + raindelay = hass.states.get("sensor.rain_bird_controller_raindelay") assert raindelay is not None assert raindelay.state == expected_state assert raindelay.attributes == { - "friendly_name": "Raindelay", + "friendly_name": "Rain Bird Controller Raindelay", "icon": "mdi:water-off", }