GledholtHall / beta-3

H E update
2 stars 3 forks source link

abbreviated HA discovery due to stale HAtype. #8

Open brycerocky opened 2 years ago

brycerocky commented 2 years ago

When selecting "Everything" under :publish these HE devices to MQTT" with Home Assistant MQTT discovery protocol, some items may not be published if a device with HAtype "unknown" is encountered first. HAtype is a global variable that is set in most cases. However, some flows do not set the value, leading to the previously set value carrying over. In this case, HADiscovery will treat the device as unsupported and will skip it.

A rudimentary fix clearing the HAtype at the end of functions that set it to "unknown" (after HA discovery function is called) publishes a more complete HA discovery.

GledholtHall commented 2 years ago

OK I can easily change that to it being absent..

Do you have an example HE device that illustrates this, and the HA MQTT Discovery message it creates and a screenshot of the MQTT expanded topics (in homie topic) if possible.