소스 검색

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 2 년 전
부모
커밋
2e01bf6043
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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_working_protocol_failures = 0
         try:
-            if dev_cid is not None:
+            if dev_cid:
                 self._api = tinytuya.Device(
                     dev_id,
                     cid=dev_cid,