mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Do not expose child modules on parent devices (#964)
Removes the logic to expose child modules on parent devices, which could cause complications with downstream consumers unknowingly duplicating things.
This commit is contained in:
@@ -2,7 +2,7 @@ import pytest
|
||||
|
||||
from kasa.iot import IotDevice
|
||||
from kasa.smart import SmartDevice
|
||||
from kasa.tests.conftest import dimmable_iot, parametrize
|
||||
from kasa.tests.conftest import dimmable_iot, get_parent_and_child_modules, parametrize
|
||||
|
||||
brightness = parametrize("brightness smart", component_filter="brightness")
|
||||
|
||||
@@ -10,13 +10,13 @@ brightness = parametrize("brightness smart", component_filter="brightness")
|
||||
@brightness
|
||||
async def test_brightness_component(dev: SmartDevice):
|
||||
"""Test brightness feature."""
|
||||
brightness = dev.modules.get("Brightness")
|
||||
brightness = next(get_parent_and_child_modules(dev, "Brightness"))
|
||||
assert brightness
|
||||
assert isinstance(dev, SmartDevice)
|
||||
assert "brightness" in dev._components
|
||||
|
||||
# Test getting the value
|
||||
feature = dev.features["brightness"]
|
||||
feature = brightness._device.features["brightness"]
|
||||
assert isinstance(feature.value, int)
|
||||
assert feature.value > 1 and feature.value <= 100
|
||||
|
||||
|
Reference in New Issue
Block a user