Add support for flux_led 0xA2 devices (#60361)

This commit is contained in:
J. Nick Koston 2021-11-25 14:20:34 -06:00 committed by GitHub
parent e5d8c69a92
commit d504c1e3e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 7 deletions

View File

@ -3,7 +3,7 @@
"name": "Flux LED/MagicHome", "name": "Flux LED/MagicHome",
"config_flow": true, "config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/flux_led", "documentation": "https://www.home-assistant.io/integrations/flux_led",
"requirements": ["flux_led==0.24.35"], "requirements": ["flux_led==0.24.37"],
"quality_scale": "platinum", "quality_scale": "platinum",
"codeowners": ["@icemanch"], "codeowners": ["@icemanch"],
"iot_class": "local_push", "iot_class": "local_push",

View File

@ -73,7 +73,7 @@ class FluxNumber(FluxEntity, CoordinatorEntity, NumberEntity):
raise HomeAssistantError( raise HomeAssistantError(
"Speed can only be adjusted when an effect is active" "Speed can only be adjusted when an effect is active"
) )
if self._device.original_addressable and not self._device.is_on: if not self._device.speed_adjust_off and not self._device.is_on:
raise HomeAssistantError("Speed can only be adjusted when the light is on") raise HomeAssistantError("Speed can only be adjusted when the light is on")
await self._device.async_set_effect( await self._device.async_set_effect(
current_effect, new_speed, _effect_brightness(self._device.brightness) current_effect, new_speed, _effect_brightness(self._device.brightness)

View File

@ -658,7 +658,7 @@ fjaraskupan==1.0.2
flipr-api==1.4.1 flipr-api==1.4.1
# homeassistant.components.flux_led # homeassistant.components.flux_led
flux_led==0.24.35 flux_led==0.24.37
# homeassistant.components.homekit # homeassistant.components.homekit
fnvhash==0.1.0 fnvhash==0.1.0

View File

@ -399,7 +399,7 @@ fjaraskupan==1.0.2
flipr-api==1.4.1 flipr-api==1.4.1
# homeassistant.components.flux_led # homeassistant.components.flux_led
flux_led==0.24.35 flux_led==0.24.37
# homeassistant.components.homekit # homeassistant.components.homekit
fnvhash==0.1.0 fnvhash==0.1.0

View File

@ -89,8 +89,7 @@ def _mocked_bulb() -> AIOWifiLedBulb:
bulb.speed = 50 bulb.speed = 50
bulb.model = "Smart Bulb (0x35)" bulb.model = "Smart Bulb (0x35)"
bulb.version_num = 8 bulb.version_num = 8
bulb.original_addressable = False bulb.speed_adjust_off = True
bulb.addressable = False
bulb.rgbwcapable = True bulb.rgbwcapable = True
bulb.color_modes = {FLUX_COLOR_MODE_RGB, FLUX_COLOR_MODE_CCT} bulb.color_modes = {FLUX_COLOR_MODE_RGB, FLUX_COLOR_MODE_CCT}
bulb.color_mode = FLUX_COLOR_MODE_RGB bulb.color_mode = FLUX_COLOR_MODE_RGB

View File

@ -121,7 +121,7 @@ async def test_original_addressable_light_effect_speed(hass: HomeAssistant) -> N
) )
config_entry.add_to_hass(hass) config_entry.add_to_hass(hass)
bulb = _mocked_bulb() bulb = _mocked_bulb()
bulb.original_addressable = True bulb.speed_adjust_off = False
bulb.raw_state = bulb.raw_state._replace( bulb.raw_state = bulb.raw_state._replace(
model_num=0xA1 model_num=0xA1
) # Original addressable model ) # Original addressable model