From 300d8bdaaa7b549466e73df52cd522c3cc477057 Mon Sep 17 00:00:00 2001 From: Teemu Rytilahti Date: Tue, 1 Nov 2022 23:01:41 +0100 Subject: [PATCH] Return action dict instead of list --- miio/device.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/miio/device.py b/miio/device.py index e7d53f056..433cd4d12 100644 --- a/miio/device.py +++ b/miio/device.py @@ -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. @@ -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