mirror of
https://github.com/home-assistant/core.git
synced 2026-07-09 15:55:29 +01:00
Set override decorator in switchbot (#175190)
This commit is contained in:
@@ -143,6 +143,7 @@ class SwitchBotStandingFanOscillationAngleNumber(SwitchbotEntity, NumberEntity):
|
||||
self._attr_unique_id = f"{coordinator.base_unique_id}_{description.key}"
|
||||
|
||||
@exception_handler
|
||||
@override
|
||||
async def async_set_native_value(self, value: float) -> None:
|
||||
"""Set oscillation angle."""
|
||||
await self.entity_description.setter(self._device, int(value))
|
||||
|
||||
@@ -106,6 +106,7 @@ class SwitchBotStandingFanNightLightSelect(SwitchbotEntity, SelectEntity):
|
||||
self._attr_unique_id = f"{coordinator.base_unique_id}_night_light"
|
||||
|
||||
@property
|
||||
@override
|
||||
def current_option(self) -> str | None:
|
||||
"""Return current night light state."""
|
||||
state = self._device.get_night_light_state()
|
||||
@@ -114,6 +115,7 @@ class SwitchBotStandingFanNightLightSelect(SwitchbotEntity, SelectEntity):
|
||||
return NIGHT_LIGHT_FROM_STATE.get(state)
|
||||
|
||||
@exception_handler
|
||||
@override
|
||||
async def async_select_option(self, option: str) -> None:
|
||||
"""Set night light state."""
|
||||
await self._device.set_night_light(NIGHT_LIGHT_TO_STATE[option])
|
||||
|
||||
Reference in New Issue
Block a user