mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-28 21:26:33 +00:00
Fix Domoticz init delaying detecting number of devices (#23724)
This commit is contained in:
parent
127fc2432c
commit
4a07148f37
@ -329,12 +329,12 @@ void MqttPublishDomoticzFanState(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DomoticzUpdateFanState(void) {
|
void DomoticzUpdateFanState(void) {
|
||||||
if (Domoticz) {
|
if (!Domoticz) { return; } // No MQTT enabled or unable to allocate memory
|
||||||
if (Domoticz->update_flag) {
|
|
||||||
MqttPublishDomoticzFanState();
|
if (Domoticz->update_flag) {
|
||||||
}
|
MqttPublishDomoticzFanState();
|
||||||
Domoticz->update_flag = true;
|
|
||||||
}
|
}
|
||||||
|
Domoticz->update_flag = true;
|
||||||
}
|
}
|
||||||
#endif // USE_SONOFF_IFAN
|
#endif // USE_SONOFF_IFAN
|
||||||
|
|
||||||
@ -374,12 +374,12 @@ void MqttPublishDomoticzPowerState(uint8_t device) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DomoticzUpdatePowerState(uint8_t device) {
|
void DomoticzUpdatePowerState(uint8_t device) {
|
||||||
if (Domoticz) {
|
if (!Domoticz) { return; } // No MQTT enabled or unable to allocate memory
|
||||||
if (Domoticz->update_flag) {
|
|
||||||
MqttPublishDomoticzPowerState(device);
|
if (Domoticz->update_flag) {
|
||||||
}
|
MqttPublishDomoticzPowerState(device);
|
||||||
Domoticz->update_flag = true;
|
|
||||||
}
|
}
|
||||||
|
Domoticz->update_flag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************************/
|
/*********************************************************************************************/
|
||||||
@ -597,6 +597,8 @@ void DomoticzSendSwitch(uint32_t type, uint32_t index, uint32_t state) {
|
|||||||
|
|
||||||
bool DomoticzSendKey(uint32_t key, uint32_t device, uint32_t state, uint32_t svalflg) {
|
bool DomoticzSendKey(uint32_t key, uint32_t device, uint32_t state, uint32_t svalflg) {
|
||||||
// If ButtonTopic or SwitchTopic is set perform DomoticzSendSwitch
|
// If ButtonTopic or SwitchTopic is set perform DomoticzSendSwitch
|
||||||
|
if (!Domoticz) { return false; } // No MQTT enabled or unable to allocate memory
|
||||||
|
|
||||||
if (svalflg) {
|
if (svalflg) {
|
||||||
if (key) { // Switch
|
if (key) { // Switch
|
||||||
if ((device <= Domoticz->switches) && Domoticz->Settings.switch_idx[device -1]) {
|
if ((device <= Domoticz->switches) && Domoticz->Settings.switch_idx[device -1]) {
|
||||||
@ -975,7 +977,7 @@ void DomoticzSaveSettings(void) {
|
|||||||
bool Xdrv07(uint32_t function) {
|
bool Xdrv07(uint32_t function) {
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
if (FUNC_PRE_INIT == function) {
|
if (FUNC_INIT == function) {
|
||||||
DomoticzInit();
|
DomoticzInit();
|
||||||
}
|
}
|
||||||
else if (Domoticz) {
|
else if (Domoticz) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user