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

Commit

Permalink
save capabilities for "main" component too
Browse files Browse the repository at this point in the history
  • Loading branch information
dwradcliffe committed Sep 8, 2023
1 parent ca4917e commit 84166bd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 1 addition & 2 deletions pysmartthings/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ def apply_data(self, data: dict):
component_id = component["id"]
if component_id == "main":
self._capabilities.extend(capabilities)
else:
self._components[component_id] = capabilities
self._components[component_id] = capabilities

if self._type == DEVICE_TYPE_DTH:
dth = data.get("dth")
Expand Down
10 changes: 10 additions & 0 deletions tests/test_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ def test_apply_data():
"light",
]
assert device.components == {
"main": [
"switch",
"switchLevel",
"refresh",
"indicator",
"sensor",
"actuator",
"healthCheck",
"light",
],
"bottomButton": ["button"],
"topButton": ["button"],
}
Expand Down

0 comments on commit 84166bd

Please sign in to comment.