Skip to content

Commit ed4a252

Browse files
committed
Adapt properties accordingly
1 parent f5b357a commit ed4a252

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

plugwise/__init__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,17 @@ def item_count(self) -> int:
112112
@property
113113
def notifications(self) -> dict[str, dict[str, str]]:
114114
"""Return the Plugwise notifications."""
115-
return self._smile_props["notifications"]
115+
if "notifications" in self._smile_props:
116+
return self._smile_props["notifications"]
117+
return {}
116118

117119
@property
118120
def reboot(self) -> bool:
119-
"""Return the reboot capability."""
120-
return self._smile_props["reboot"]
121+
"""Return the reboot capability.
122+
123+
All non-legacy devices support gateway-rebooting.
124+
"""
125+
return not self.smile_legacy
121126

122127
async def connect(self) -> Version | None:
123128
"""Connect to the Plugwise Gateway and determine its name, type, version, and other data."""

0 commit comments

Comments
 (0)