コード例 #1
0
ファイル: select.py プロジェクト: oyvindwe/home-assistant
 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()
コード例 #2
0
ファイル: fan.py プロジェクト: mzoworka/home_assistant_core
    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),
        )