Skip to content

Commit

Permalink
Return action dict instead of list
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti committed Nov 1, 2022
1 parent b15d0ac commit 300d8bd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions miio/device.py
Expand Up @@ -241,12 +241,12 @@ def status(self) -> DeviceStatus:
"""Return device status."""
raise NotImplementedError()

def actions(self) -> List[ActionDescriptor]:
"""Return a list of actions."""
return []
def actions(self) -> Dict[str, ActionDescriptor]:
"""Return device actions."""
return {}

def settings(self) -> Dict[str, SettingDescriptor]:
"""Return list of settings."""
"""Return device settings."""
settings = self.status().settings()
for setting in settings.values():
# TODO: Bind setter methods, this should probably done only once during init.
Expand All @@ -262,7 +262,7 @@ def settings(self) -> Dict[str, SettingDescriptor]:
return settings

def sensors(self) -> Dict[str, SensorDescriptor]:
"""Return sensors."""
"""Return device sensors."""
# TODO: the latest status should be cached and re-used by all meta information getters
sensors = self.status().sensors()
return sensors
Expand Down

0 comments on commit 300d8bd

Please sign in to comment.