diff --git a/homeassistant/components/switchbot/icons.json b/homeassistant/components/switchbot/icons.json index b4bf6e4623db..9eb0db2eefea 100644 --- a/homeassistant/components/switchbot/icons.json +++ b/homeassistant/components/switchbot/icons.json @@ -144,6 +144,27 @@ } } }, + "number": { + "horizontal_oscillation_angle": { + "default": "mdi:pan-horizontal" + }, + "vertical_oscillation_angle": { + "default": "mdi:pan-vertical" + } + }, + "select": { + "night_light": { + "default": "mdi:lightbulb", + "state": { + "bright": "mdi:lightbulb-on-70", + "off": "mdi:lightbulb-off", + "soft": "mdi:lightbulb-on-30" + } + }, + "time_format": { + "default": "mdi:clock-outline" + } + }, "sensor": { "aqi_quality_level": { "default": "mdi:air-filter", @@ -195,6 +216,12 @@ "on": "mdi:lock" } }, + "horizontal_oscillation": { + "default": "mdi:arrow-left-right" + }, + "vertical_oscillation": { + "default": "mdi:arrow-up-down" + }, "wireless_charging": { "state": { "off": "mdi:battery-charging-wireless-outline", diff --git a/homeassistant/components/switchbot/quality_scale.yaml b/homeassistant/components/switchbot/quality_scale.yaml index 8179fe154609..87cd224fa6ad 100644 --- a/homeassistant/components/switchbot/quality_scale.yaml +++ b/homeassistant/components/switchbot/quality_scale.yaml @@ -73,10 +73,7 @@ rules: entity-disabled-by-default: done entity-translations: done exception-translations: done - icon-translations: - status: exempt - comment: | - No custom icons. + icon-translations: done reconfiguration-flow: status: exempt comment: | diff --git a/homeassistant/components/switchbot/select.py b/homeassistant/components/switchbot/select.py index ebe5a8737359..58e761b3ee0a 100644 --- a/homeassistant/components/switchbot/select.py +++ b/homeassistant/components/switchbot/select.py @@ -79,13 +79,13 @@ class SwitchBotMeterProCO2TimeFormatSelect(SwitchbotEntity, SelectEntity): NIGHT_LIGHT_OFF = "off" -NIGHT_LIGHT_LEVEL_1 = "level_1" -NIGHT_LIGHT_LEVEL_2 = "level_2" -NIGHT_LIGHT_OPTIONS = [NIGHT_LIGHT_OFF, NIGHT_LIGHT_LEVEL_1, NIGHT_LIGHT_LEVEL_2] +NIGHT_LIGHT_BRIGHT = "bright" +NIGHT_LIGHT_SOFT = "soft" +NIGHT_LIGHT_OPTIONS = [NIGHT_LIGHT_OFF, NIGHT_LIGHT_SOFT, NIGHT_LIGHT_BRIGHT] NIGHT_LIGHT_TO_STATE: dict[str, NightLightState] = { NIGHT_LIGHT_OFF: NightLightState.OFF, - NIGHT_LIGHT_LEVEL_1: NightLightState.LEVEL_1, - NIGHT_LIGHT_LEVEL_2: NightLightState.LEVEL_2, + NIGHT_LIGHT_SOFT: NightLightState.LEVEL_2, + NIGHT_LIGHT_BRIGHT: NightLightState.LEVEL_1, } NIGHT_LIGHT_FROM_STATE: dict[int, str] = { state.value: option for option, state in NIGHT_LIGHT_TO_STATE.items() diff --git a/homeassistant/components/switchbot/strings.json b/homeassistant/components/switchbot/strings.json index 776316e7429d..a8eca51577fb 100644 --- a/homeassistant/components/switchbot/strings.json +++ b/homeassistant/components/switchbot/strings.json @@ -312,9 +312,9 @@ "night_light": { "name": "Night light", "state": { - "level_1": "Level 1", - "level_2": "Level 2", - "off": "[%key:common::state::off%]" + "bright": "Bright", + "off": "[%key:common::state::off%]", + "soft": "Soft" } }, "time_format": { diff --git a/tests/components/switchbot/test_select.py b/tests/components/switchbot/test_select.py index f2dbfb1dfb1b..530da63ec82f 100644 --- a/tests/components/switchbot/test_select.py +++ b/tests/components/switchbot/test_select.py @@ -129,8 +129,8 @@ async def test_set_time_format( @pytest.mark.parametrize( ("device_state", "option", "expected_state"), [ - (NightLightState.OFF.value, "level_1", NightLightState.LEVEL_1), - (NightLightState.LEVEL_1.value, "level_2", NightLightState.LEVEL_2), + (NightLightState.OFF.value, "bright", NightLightState.LEVEL_1), + (NightLightState.LEVEL_1.value, "soft", NightLightState.LEVEL_2), (NightLightState.LEVEL_2.value, "off", NightLightState.OFF), ], )