Просмотр исходного кода

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 5 лет назад
Родитель
Сommit
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