Skip to content

Commit 05fc576

Browse files
committed
Avoid adding "_plug" when already present
1 parent 205265e commit 05fc576

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

plugwise/helper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def extend_plug_device_class(appl: Munch, appliance: etree.Element) -> None:
6464
(search := appliance.find("description")) is not None
6565
and (description := search.text) is not None
6666
and ("ZigBee protocol" in description or "smart plug" in description)
67+
and not appl.pwclass.endswith("_plug")
6768
):
6869
appl.pwclass = f"{appl.pwclass}_plug"
6970

0 commit comments

Comments
 (0)