Add missing icons and rename night light options for SwitchBot standing fan (#177634)

This commit is contained in:
Paul Bottein
2026-07-30 23:36:42 +02:00
committed by Bram Kragten
parent c506c545e4
commit 6982886d7c
5 changed files with 38 additions and 14 deletions
@@ -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",
@@ -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: |
+5 -5
View File
@@ -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()
@@ -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": {
+2 -2
View File
@@ -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),
],
)