mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Update python-kasa to 0.5.1 (#88416)
This commit is contained in:
parent
6cbad61572
commit
1d928f05fa
@ -232,7 +232,7 @@ class TPLinkSmartBulb(CoordinatedTPLinkEntity, LightEntity):
|
|||||||
if brightness is not None:
|
if brightness is not None:
|
||||||
await self.device.set_brightness(brightness, transition=transition)
|
await self.device.set_brightness(brightness, transition=transition)
|
||||||
return
|
return
|
||||||
await self.device.turn_on(transition=transition) # type: ignore[arg-type]
|
await self.device.turn_on(transition=transition)
|
||||||
|
|
||||||
@async_refresh_after
|
@async_refresh_after
|
||||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||||
@ -338,10 +338,9 @@ class TPLinkSmartLightStrip(TPLinkSmartBulb):
|
|||||||
"""Turn the light on."""
|
"""Turn the light on."""
|
||||||
brightness, transition = self._async_extract_brightness_transition(**kwargs)
|
brightness, transition = self._async_extract_brightness_transition(**kwargs)
|
||||||
if ATTR_EFFECT in kwargs:
|
if ATTR_EFFECT in kwargs:
|
||||||
await self.device.set_effect(kwargs[ATTR_EFFECT])
|
await self.device.set_effect(
|
||||||
# We need to set the brightness separately until upstream allows defining it for set_effect.
|
kwargs[ATTR_EFFECT], brightness=brightness, transition=transition
|
||||||
if brightness is not None:
|
)
|
||||||
await self._async_turn_on_with_brightness(brightness, transition)
|
|
||||||
elif ATTR_COLOR_TEMP in kwargs:
|
elif ATTR_COLOR_TEMP in kwargs:
|
||||||
if self.effect:
|
if self.effect:
|
||||||
# If there is an effect in progress
|
# If there is an effect in progress
|
||||||
|
@ -137,5 +137,5 @@
|
|||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
"loggers": ["kasa"],
|
"loggers": ["kasa"],
|
||||||
"quality_scale": "platinum",
|
"quality_scale": "platinum",
|
||||||
"requirements": ["python-kasa==0.5.0"]
|
"requirements": ["python-kasa==0.5.1"]
|
||||||
}
|
}
|
||||||
|
@ -2072,7 +2072,7 @@ python-join-api==0.0.9
|
|||||||
python-juicenet==1.1.0
|
python-juicenet==1.1.0
|
||||||
|
|
||||||
# homeassistant.components.tplink
|
# homeassistant.components.tplink
|
||||||
python-kasa==0.5.0
|
python-kasa==0.5.1
|
||||||
|
|
||||||
# homeassistant.components.lirc
|
# homeassistant.components.lirc
|
||||||
# python-lirc==1.2.3
|
# python-lirc==1.2.3
|
||||||
|
@ -1471,7 +1471,7 @@ python-izone==1.2.9
|
|||||||
python-juicenet==1.1.0
|
python-juicenet==1.1.0
|
||||||
|
|
||||||
# homeassistant.components.tplink
|
# homeassistant.components.tplink
|
||||||
python-kasa==0.5.0
|
python-kasa==0.5.1
|
||||||
|
|
||||||
# homeassistant.components.matter
|
# homeassistant.components.matter
|
||||||
python-matter-server==2.1.1
|
python-matter-server==2.1.1
|
||||||
|
@ -431,22 +431,11 @@ async def test_smart_strip_effects(hass: HomeAssistant) -> None:
|
|||||||
{ATTR_ENTITY_ID: entity_id, ATTR_EFFECT: "Effect2"},
|
{ATTR_ENTITY_ID: entity_id, ATTR_EFFECT: "Effect2"},
|
||||||
blocking=True,
|
blocking=True,
|
||||||
)
|
)
|
||||||
strip.set_effect.assert_called_once_with("Effect2")
|
strip.set_effect.assert_called_once_with(
|
||||||
strip.set_effect.reset_mock()
|
"Effect2", brightness=None, transition=None
|
||||||
|
|
||||||
# Setting an effect with brightness calls set_brightness implicitly
|
|
||||||
await hass.services.async_call(
|
|
||||||
LIGHT_DOMAIN,
|
|
||||||
"turn_on",
|
|
||||||
{ATTR_ENTITY_ID: entity_id, ATTR_EFFECT: "Effect2", ATTR_BRIGHTNESS: 255},
|
|
||||||
blocking=True,
|
|
||||||
)
|
)
|
||||||
strip.set_effect.assert_called_once_with("Effect2")
|
|
||||||
strip.set_effect.reset_mock()
|
strip.set_effect.reset_mock()
|
||||||
|
|
||||||
strip.set_brightness.assert_called_with(100, transition=None)
|
|
||||||
strip.set_brightness.reset_mock()
|
|
||||||
|
|
||||||
strip.effect = {"name": "Effect1", "enable": 0, "custom": 0}
|
strip.effect = {"name": "Effect1", "enable": 0, "custom": 0}
|
||||||
async_fire_time_changed(hass, dt_util.utcnow() + timedelta(seconds=10))
|
async_fire_time_changed(hass, dt_util.utcnow() + timedelta(seconds=10))
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user