Fix HASS discovery for MI sensors - workaround is to use 'mi32option6 1'

This commit is contained in:
Simon Hailes 2021-02-19 13:35:39 +00:00
parent e56c8b1845
commit cabfc4f699
1 changed files with 11 additions and 0 deletions

View File

@ -1937,13 +1937,24 @@ void MI32Every50mSecond(){
void MI32EverySecond(bool restart){
#ifdef USE_HOME_ASSISTANT
if(Settings.flag.hass_discovery){
// fixes bug introduced - just by forcing this mode.
MI32.option.MQTTType = 1;
}
#endif
// AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("M32: onesec"));
MI32TimeoutSensors();
if (MI32.option.MQTTType == 0){
// show tas style sensor MQTT
MI32ShowSomeSensors();
} else {
// these two share a counter
// discovery only sent if hass_discovery
MI32DiscoveryOneMISensor();
// show independent style sensor MQTT
MI32ShowOneMISensor();
}