diff --git a/homeassistant/components/wilight/__init__.py b/homeassistant/components/wilight/__init__.py index 326265b8b3f..58ba237ae68 100644 --- a/homeassistant/components/wilight/__init__.py +++ b/homeassistant/components/wilight/__init__.py @@ -56,6 +56,7 @@ class WiLightDevice(Entity): """ _attr_should_poll = False + _attr_has_entity_name = True def __init__(self, api_device: PyWiLightDevice, index: str, item_name: str) -> None: """Initialize the device.""" @@ -65,7 +66,6 @@ class WiLightDevice(Entity): self._index = index self._status: dict[str, Any] = {} - self._attr_name = item_name self._attr_unique_id = f"{self._device_id}_{index}" self._attr_device_info = DeviceInfo( name=item_name, diff --git a/homeassistant/components/wilight/cover.py b/homeassistant/components/wilight/cover.py index cd0a3cc21ac..aa50b79f139 100644 --- a/homeassistant/components/wilight/cover.py +++ b/homeassistant/components/wilight/cover.py @@ -57,6 +57,8 @@ def hass_to_wilight_position(value: int) -> int: class WiLightCover(WiLightDevice, CoverEntity): """Representation of a WiLights cover.""" + _attr_name = None + @property def current_cover_position(self) -> int | None: """Return current position of cover. diff --git a/homeassistant/components/wilight/fan.py b/homeassistant/components/wilight/fan.py index 3d0c6d0ff39..ba9a108f636 100644 --- a/homeassistant/components/wilight/fan.py +++ b/homeassistant/components/wilight/fan.py @@ -54,6 +54,7 @@ async def async_setup_entry( class WiLightFan(WiLightDevice, FanEntity): """Representation of a WiLights fan.""" + _attr_name = None _attr_icon = "mdi:fan" _attr_speed_count = len(ORDERED_NAMED_FAN_SPEEDS) _attr_supported_features = FanEntityFeature.SET_SPEED | FanEntityFeature.DIRECTION diff --git a/homeassistant/components/wilight/light.py b/homeassistant/components/wilight/light.py index 2509dc50737..b17eac36f09 100644 --- a/homeassistant/components/wilight/light.py +++ b/homeassistant/components/wilight/light.py @@ -53,6 +53,7 @@ async def async_setup_entry( class WiLightLightOnOff(WiLightDevice, LightEntity): """Representation of a WiLights light on-off.""" + _attr_name = None _attr_color_mode = ColorMode.ONOFF _attr_supported_color_modes = {ColorMode.ONOFF} @@ -73,6 +74,7 @@ class WiLightLightOnOff(WiLightDevice, LightEntity): class WiLightLightDimmer(WiLightDevice, LightEntity): """Representation of a WiLights light dimmer.""" + _attr_name = None _attr_color_mode = ColorMode.BRIGHTNESS _attr_supported_color_modes = {ColorMode.BRIGHTNESS} @@ -124,6 +126,7 @@ def hass_to_wilight_saturation(value: float) -> int: class WiLightLightColor(WiLightDevice, LightEntity): """Representation of a WiLights light rgb.""" + _attr_name = None _attr_color_mode = ColorMode.HS _attr_supported_color_modes = {ColorMode.HS} diff --git a/homeassistant/components/wilight/strings.json b/homeassistant/components/wilight/strings.json index a287104e7ad..ccba52d99e0 100644 --- a/homeassistant/components/wilight/strings.json +++ b/homeassistant/components/wilight/strings.json @@ -12,6 +12,16 @@ "not_wilight_device": "This Device is not WiLight" } }, + "entity": { + "switch": { + "watering": { + "name": "Watering" + }, + "pause": { + "name": "Pause" + } + } + }, "services": { "set_watering_time": { "name": "Set watering time", diff --git a/homeassistant/components/wilight/switch.py b/homeassistant/components/wilight/switch.py index f2d74cce359..101162302ae 100644 --- a/homeassistant/components/wilight/switch.py +++ b/homeassistant/components/wilight/switch.py @@ -148,10 +148,7 @@ def hass_to_wilight_pause_time(value: int) -> int: class WiLightValveSwitch(WiLightDevice, SwitchEntity): """Representation of a WiLights Valve switch.""" - @property - def name(self) -> str: - """Return the name of the switch.""" - return f"{self._attr_name} {DESC_WATERING}" + _attr_translation_key = "watering" @property def is_on(self) -> bool: @@ -272,10 +269,7 @@ class WiLightValveSwitch(WiLightDevice, SwitchEntity): class WiLightValvePauseSwitch(WiLightDevice, SwitchEntity): """Representation of a WiLights Valve Pause switch.""" - @property - def name(self) -> str: - """Return the name of the switch.""" - return f"{self._attr_name} {DESC_PAUSE}" + _attr_translation_key = "pause" @property def is_on(self) -> bool: