mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-08 03:34:02 +00:00
Change state_information to return feature values (#804)
This changes `state_information` to return the names and values of all defined features. It was originally a "temporary" hack to show some extra, device-specific information in the cli tool, but now that we have device-defined features we can leverage them.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
"""Module for light strips (KL430)."""
|
||||
from typing import Any, Dict, List, Optional
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
from ..device_type import DeviceType
|
||||
from ..deviceconfig import DeviceConfig
|
||||
@@ -84,18 +84,6 @@ class IotLightStrip(IotBulb):
|
||||
"""
|
||||
return EFFECT_NAMES_V1 if self.has_effects else None
|
||||
|
||||
@property # type: ignore
|
||||
@requires_update
|
||||
def state_information(self) -> Dict[str, Any]:
|
||||
"""Return strip specific state information."""
|
||||
info = super().state_information
|
||||
|
||||
info["Length"] = self.length
|
||||
if self.has_effects:
|
||||
info["Effect"] = self.effect["name"]
|
||||
|
||||
return info
|
||||
|
||||
@requires_update
|
||||
async def set_effect(
|
||||
self,
|
||||
|
Reference in New Issue
Block a user