Explorar o código

Treat empty cid the same as no cid

When processing user entry through the config flow, we get
an empty string rather than None for an empty cid field.
This causes the test connection to fail when reconfiguring
(but not the original connection for some reason, otherwise
this would have been noticed sooner than 6 months after the
introduction of cid support).

Issue #1110
Jason Rumney %!s(int64=2) %!d(string=hai) anos
pai
achega
2e01bf6043
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      custom_components/tuya_local/device.py

+ 1 - 1
custom_components/tuya_local/device.py

@@ -66,7 +66,7 @@ class TuyaLocalDevice(object):
         self._api_protocol_working = False
         self._api_protocol_working = False
         self._api_working_protocol_failures = 0
         self._api_working_protocol_failures = 0
         try:
         try:
-            if dev_cid is not None:
+            if dev_cid:
                 self._api = tinytuya.Device(
                 self._api = tinytuya.Device(
                     dev_id,
                     dev_id,
                     cid=dev_cid,
                     cid=dev_cid,