mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-12 18:38:03 +00:00
Add module.device to the public api (#1478)
This commit is contained in:
@@ -176,7 +176,7 @@ async def test_light_brightness(dev: Device):
|
||||
assert light
|
||||
|
||||
# Test getting the value
|
||||
feature = light._device.features["brightness"]
|
||||
feature = light.device.features["brightness"]
|
||||
assert feature.minimum_value == 0
|
||||
assert feature.maximum_value == 100
|
||||
|
||||
@@ -205,7 +205,7 @@ async def test_light_color_temp(dev: Device):
|
||||
)
|
||||
|
||||
# Test getting the value
|
||||
feature = light._device.features["color_temperature"]
|
||||
feature = light.device.features["color_temperature"]
|
||||
assert isinstance(feature.minimum_value, int)
|
||||
assert isinstance(feature.maximum_value, int)
|
||||
|
||||
@@ -237,7 +237,7 @@ async def test_light_set_state(dev: Device):
|
||||
light = next(get_parent_and_child_modules(dev, Module.Light))
|
||||
assert light
|
||||
# For fixtures that have a light effect active switch off
|
||||
if light_effect := light._device.modules.get(Module.LightEffect):
|
||||
if light_effect := light.device.modules.get(Module.LightEffect):
|
||||
await light_effect.set_effect(light_effect.LIGHT_EFFECTS_OFF)
|
||||
|
||||
await light.set_state(LightState(light_on=False))
|
||||
@@ -264,7 +264,7 @@ async def test_light_preset_module(dev: Device, mocker: MockerFixture):
|
||||
assert preset_mod
|
||||
light_mod = next(get_parent_and_child_modules(dev, Module.Light))
|
||||
assert light_mod
|
||||
feat = preset_mod._device.features["light_preset"]
|
||||
feat = preset_mod.device.features["light_preset"]
|
||||
|
||||
preset_list = preset_mod.preset_list
|
||||
assert "Not set" in preset_list
|
||||
|
Reference in New Issue
Block a user