Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
add method to safely retrieve the list of disabled components
Browse files Browse the repository at this point in the history
  • Loading branch information
dwradcliffe committed Sep 8, 2023
1 parent 84166bd commit cef9afa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pysmartthings/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 []

Check warning on line 235 in pysmartthings/device.py

View check run for this annotation

Codecov / codecov/patch

pysmartthings/device.py#L233-L235

Added lines #L233 - L235 were not covered by tests

@property
def color(self) -> Optional[str]:
"""Get the color attribute."""
Expand Down

0 comments on commit cef9afa

Please sign in to comment.