Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion plugwise_usb/nodes/circle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,8 @@ async def get_state(self, features: tuple[NodeFeature]) -> dict[NodeFeature, Any
)
case _:
state_result = await super().get_state((feature,))
states[feature] = state_result[feature]
if feature in state_result:
states[feature] = state_result[feature]

if NodeFeature.AVAILABLE not in states:
states[NodeFeature.AVAILABLE] = self.available_state
Expand Down
7 changes: 4 additions & 3 deletions plugwise_usb/nodes/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,9 +633,10 @@ async def get_state(self, features: tuple[NodeFeature]) -> dict[NodeFeature, Any
case NodeFeature.PING:
states[NodeFeature.PING] = await self.ping_update()
case _:
raise NodeError(
f"Update of feature '{feature.name}' is "
+ f"not supported for {self.mac}"
_LOGGER.debug(
"Update of feature '%s' does not return any data for %s",
feature.name,
self.mac,
)
Comment thread
dirixmjm marked this conversation as resolved.

return states
Expand Down
3 changes: 2 additions & 1 deletion plugwise_usb/nodes/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,8 @@ async def get_state(self, features: tuple[NodeFeature]) -> dict[NodeFeature, Any
states[NodeFeature.MOTION_CONFIG] = self._motion_config
case _:
state_result = await super().get_state((feature,))
states[feature] = state_result[feature]
if feature in state_result:
states[feature] = state_result[feature]

if NodeFeature.AVAILABLE not in states:
states[NodeFeature.AVAILABLE] = self.available_state
Expand Down
3 changes: 2 additions & 1 deletion plugwise_usb/nodes/sed.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,7 @@ async def get_state(self, features: tuple[NodeFeature]) -> dict[NodeFeature, Any
states[NodeFeature.BATTERY] = self._battery_config
case _:
state_result = await super().get_state((feature,))
states[feature] = state_result[feature]
if feature in state_result:
states[feature] = state_result[feature]

return states
3 changes: 2 additions & 1 deletion plugwise_usb/nodes/sense.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ async def get_state(self, features: tuple[NodeFeature]) -> dict[NodeFeature, Any
states[NodeFeature.SENSE] = self._sense_statistics
case _:
state_result = await super().get_state((feature,))
states[feature] = state_result[feature]
if feature in state_result:
states[feature] = state_result[feature]

if NodeFeature.AVAILABLE not in states:
states[NodeFeature.AVAILABLE] = self.available_state
Expand Down
3 changes: 2 additions & 1 deletion plugwise_usb/nodes/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ async def get_state(self, features: tuple[NodeFeature]) -> dict[NodeFeature, Any
states[NodeFeature.SWITCH] = self._switch
case _:
state_result = await super().get_state((feature,))
states[feature] = state_result[feature]
if feature in state_result:
states[feature] = state_result[feature]

if NodeFeature.AVAILABLE not in states:
states[NodeFeature.AVAILABLE] = self.available_state
Expand Down
Loading