Exemplo n.º 1
0
 async def async_set_led_brightness(self, brightness: str):
     """Set the led brightness."""
     if await self._try_command(
             "Setting the led brightness of the miio device failed.",
             self._device.set_led_brightness,
             AirhumidifierLedBrightness(LED_BRIGHTNESS_MAP[brightness]),
     ):
         self._current_led_brightness = LED_BRIGHTNESS_MAP[brightness]
         self.async_write_ha_state()
Exemplo n.º 2
0
    async def async_set_led_brightness(self, brightness: int = 2):
        """Set the led brightness."""
        if self._device_features & FEATURE_SET_LED_BRIGHTNESS == 0:
            return

        await self._try_command(
            "Setting the led brightness of the miio device failed.",
            self._device.set_led_brightness,
            AirhumidifierLedBrightness(brightness),
        )