mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-06 18:54:08 +00:00
Improve categorization of features (#904)
This updates the categorization of features and makes the id mandatory for features
This commit is contained in:
@@ -19,6 +19,7 @@ def dummy_feature() -> Feature:
|
||||
|
||||
feat = Feature(
|
||||
device=DummyDevice(), # type: ignore[arg-type]
|
||||
id="dummy_feature",
|
||||
name="dummy_feature",
|
||||
attribute_getter="dummygetter",
|
||||
attribute_setter="dummysetter",
|
||||
@@ -47,6 +48,7 @@ def test_feature_missing_type():
|
||||
with pytest.raises(ValueError):
|
||||
Feature(
|
||||
device=DummyDevice(), # type: ignore[arg-type]
|
||||
id="dummy_error",
|
||||
name="dummy error",
|
||||
attribute_getter="dummygetter",
|
||||
attribute_setter="dummysetter",
|
||||
@@ -104,6 +106,7 @@ async def test_feature_action(mocker):
|
||||
"""Test that setting value on button calls the setter."""
|
||||
feat = Feature(
|
||||
device=DummyDevice(), # type: ignore[arg-type]
|
||||
id="dummy_feature",
|
||||
name="dummy_feature",
|
||||
attribute_setter="call_action",
|
||||
container=None,
|
||||
|
Reference in New Issue
Block a user