Fixed bug with unknown switches, that was sent to gateway and makes an error
This commit is contained in:
@@ -105,6 +105,7 @@ class Mqtt:
|
||||
name = "" # we will find it next
|
||||
sid = query_sid
|
||||
|
||||
isFound = False
|
||||
for current_sid in self._sids:
|
||||
if (current_sid == None):
|
||||
continue
|
||||
@@ -116,11 +117,15 @@ class Mqtt:
|
||||
if (sidname == query_sid and sidmodel == model):
|
||||
sid = current_sid
|
||||
name = sidname
|
||||
isFound = True
|
||||
break
|
||||
else:
|
||||
_LOGGER.debug(sidmodel + "-" + sidname + " is not " + model + "-" + query_sid + ".")
|
||||
continue
|
||||
|
||||
if isFound == False:
|
||||
return
|
||||
|
||||
# fix for rgb format
|
||||
if (param == "rgb" and "," in str(value)):
|
||||
value = self._color_rgb_to_xiaomi(value)
|
||||
|
||||
Reference in New Issue
Block a user