From cef9afa1e489873f48ac5bb5b7ebcb55cde0858b Mon Sep 17 00:00:00 2001 From: David Radcliffe Date: Fri, 8 Sep 2023 08:30:56 -0400 Subject: [PATCH] add method to safely retrieve the list of disabled components --- pysmartthings/device.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pysmartthings/device.py b/pysmartthings/device.py index acf874f..b13da9c 100644 --- a/pysmartthings/device.py +++ b/pysmartthings/device.py @@ -227,6 +227,13 @@ def values(self) -> Dict[str, Any]: lambda: None, {k: v.value for k, v in self._attributes.items()} ) + @property + def disabled_components(self) -> []: + """Get the list of disabled components for this device.""" + if self._attributes.get("disabledComponents"): + return self._attributes["disabledComponents"].value + return [] + @property def color(self) -> Optional[str]: """Get the color attribute."""