mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-20 06:18:01 +00:00
Embed FeatureType inside Feature (#860)
Moves `FeatureType` into `Feature` to make it easier to use the API. This also enforces that no invalid types are accepted (i.e., `Category.Config` cannot be a `Sensor`) If `--verbose` is used with the cli tool, some extra information is displayed for features when in the state command.
This commit is contained in:
@@ -27,6 +27,7 @@ class AutoOffModule(SmartModule):
|
||||
container=self,
|
||||
attribute_getter="enabled",
|
||||
attribute_setter="set_enabled",
|
||||
type=Feature.Type.Switch,
|
||||
)
|
||||
)
|
||||
self._add_feature(
|
||||
@@ -36,6 +37,7 @@ class AutoOffModule(SmartModule):
|
||||
container=self,
|
||||
attribute_getter="delay",
|
||||
attribute_setter="set_delay",
|
||||
type=Feature.Type.Number,
|
||||
)
|
||||
)
|
||||
self._add_feature(
|
||||
|
Reference in New Issue
Block a user