Created
July 22, 2019 19:20
-
-
Save bwarden/947fd5932fb97f9af401a435ba08504a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/home_assistant/custom_components/switch.py b/home_assistant/custom_components/switch.py | |
index 841b2a4..2f9d26f 100644 | |
--- a/home_assistant/custom_components/switch.py | |
+++ b/home_assistant/custom_components/switch.py | |
@@ -51,7 +51,10 @@ class VeSyncSwitchHA(SwitchDevice): | |
@property | |
def unique_id(self): | |
"""Return the ID of this switch.""" | |
- return self.smartplug.cid | |
+ if hasattr(self.smartplug, 'sub_device_no'): | |
+ return self.smartplug.cid + str(self.smartplug.sub_device_no) | |
+ else: | |
+ return self.smartplug.cid | |
@property | |
def name(self): |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment