Skip to content

Commit 6acf014

Browse files
committed
Correct model when node_type and model don't match
1 parent 86b0381 commit 6acf014

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

plugwise_usb/nodes/node.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,14 @@ async def update_node_details(
510510
hardware, model_info = version_to_model(hardware)
511511
model_info = model_info.split(" ")
512512
self._node_info.model = model_info[0]
513-
_LOGGER.debug("NodeType: %s", self._node_info.node_type)
513+
if (
514+
self._node_info.node_type is not None
515+
and (
516+
correct_model := str(self._node_info.node_type.name).lower()
517+
) not in self._node_info.model.lower()
518+
):
519+
self._node_info.model = correct_model.capitalize()
520+
514521
# Handle + devices
515522
if len(model_info) > 1 and "+" in model_info[1]:
516523
self._node_info.model = model_info[0] + " " + model_info[1]
@@ -542,6 +549,7 @@ async def update_node_details(
542549
minutes=5
543550
):
544551
await self._available_update_state(True, timestamp)
552+
545553
return complete
546554

547555
async def is_online(self) -> bool:

0 commit comments

Comments
 (0)