From f6169c442a425e31395df61716a10b5e38f1fb37 Mon Sep 17 00:00:00 2001 From: rospogrigio Date: Thu, 3 Sep 2020 16:39:06 +0200 Subject: [PATCH] Appended subswitch id (i.e., dps) to the unique_id to allow different unique_ids for subswitches --- custom_components/localtuya/switch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/localtuya/switch.py b/custom_components/localtuya/switch.py index 1eb8529..e3737eb 100644 --- a/custom_components/localtuya/switch.py +++ b/custom_components/localtuya/switch.py @@ -224,7 +224,7 @@ class TuyaDevice(SwitchEntity): @property def unique_id(self): """Return unique device identifier.""" - return f"local_{self._device.unique_id}" + return f"local_{self._device.unique_id}_{self._switch_id}" @property def available(self):