瀏覽代碼

Detect Kogan heater when testing the connection

Kogan heaters do not have a dps at index 1.  If 1 is missing, check for index 3 before failing.
Index 3 is current temperature, which always comes even when the heater is off.
Jason Rumney 6 年之前
父節點
當前提交
aad83338bc
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      custom_components/tuya_local/config_flow.py

+ 1 - 1
custom_components/tuya_local/config_flow.py

@@ -68,4 +68,4 @@ class OptionsFlowHandler(config_entries.OptionsFlow):
 async def async_test_connection(config: dict, hass: HomeAssistant):
     device = TuyaLocalDevice("Test", config[CONF_DEVICE_ID], config[CONF_HOST], config[CONF_LOCAL_KEY], hass)
     await device.async_refresh()
-    return device.get_property("1") is not None
+    return device.get_property("1") is not None || device.get_property("3") is not None