mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 03:36:42 +00:00
Fix full status for secondary device groups
This commit is contained in:
parent
7c63f3e51c
commit
bde7f3206e
@ -498,7 +498,12 @@ bool _SendDeviceGroupMessage(uint8_t device_group_index, DevGroupMessageType mes
|
|||||||
building_status_message = true;
|
building_status_message = true;
|
||||||
|
|
||||||
// Call the drivers to build the status update.
|
// Call the drivers to build the status update.
|
||||||
SendDeviceGroupMessage(device_group_index, DGR_MSGTYP_PARTIAL_UPDATE, DGR_ITEM_POWER, TasmotaGlobal.power);
|
power_t power = TasmotaGlobal.power;
|
||||||
|
if (Settings.flag4.multiple_device_groups) { // SetOption88 - Enable relays in separate device groups
|
||||||
|
power >>= device_group_index;
|
||||||
|
power &= 1;
|
||||||
|
}
|
||||||
|
SendDeviceGroupMessage(device_group_index, DGR_MSGTYP_PARTIAL_UPDATE, DGR_ITEM_POWER, power);
|
||||||
XdrvMailbox.index = 0;
|
XdrvMailbox.index = 0;
|
||||||
if (device_group_index == 0 && first_device_group_is_local) XdrvMailbox.index = DGR_FLAG_LOCAL;
|
if (device_group_index == 0 && first_device_group_is_local) XdrvMailbox.index = DGR_FLAG_LOCAL;
|
||||||
XdrvMailbox.command_code = DGR_ITEM_STATUS;
|
XdrvMailbox.command_code = DGR_ITEM_STATUS;
|
||||||
|
@ -254,6 +254,12 @@ void PWMDimmerHandleDevGroupItem(void)
|
|||||||
#endif // USE_PWM_DIMMER_REMOTE
|
#endif // USE_PWM_DIMMER_REMOTE
|
||||||
SendLocalDeviceGroupMessage(DGR_MSGTYP_UPDATE, DGR_ITEM_BRI_POWER_ON, Settings.bri_power_on,
|
SendLocalDeviceGroupMessage(DGR_MSGTYP_UPDATE, DGR_ITEM_BRI_POWER_ON, Settings.bri_power_on,
|
||||||
DGR_ITEM_BRI_PRESET_LOW, Settings.bri_preset_low, DGR_ITEM_BRI_PRESET_HIGH, Settings.bri_preset_high);
|
DGR_ITEM_BRI_PRESET_LOW, Settings.bri_preset_low, DGR_ITEM_BRI_PRESET_HIGH, Settings.bri_preset_high);
|
||||||
|
#ifdef USE_PWM_DIMMER_REMOTE
|
||||||
|
else
|
||||||
|
SendDeviceGroupMessage(device_group_index, DGR_MSGTYP_UPDATE, DGR_ITEM_POWER, remote_pwm_dimmer->power_on,
|
||||||
|
DGR_ITEM_BRI_POWER_ON, remote_pwm_dimmer->bri_power_on, DGR_ITEM_BRI_PRESET_LOW, remote_pwm_dimmer->bri_preset_low,
|
||||||
|
DGR_ITEM_BRI_PRESET_HIGH, remote_pwm_dimmer->bri_preset_high);
|
||||||
|
#endif // USE_PWM_DIMMER_REMOTE
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -614,7 +620,7 @@ void PWMDimmerHandleButton(uint32_t button_index, bool pressed)
|
|||||||
char topic[TOPSZ];
|
char topic[TOPSZ];
|
||||||
sprintf_P(TasmotaGlobal.mqtt_data, PSTR("Trigger%u"), mqtt_trigger);
|
sprintf_P(TasmotaGlobal.mqtt_data, PSTR("Trigger%u"), mqtt_trigger);
|
||||||
#ifdef USE_PWM_DIMMER_REMOTE
|
#ifdef USE_PWM_DIMMER_REMOTE
|
||||||
if (active_remote_pwm_dimmer) {
|
if (Settings.flag4.multiple_device_groups) {
|
||||||
snprintf_P(topic, sizeof(topic), PSTR("cmnd/%s/EVENT"), device_groups[power_button_index].group_name);
|
snprintf_P(topic, sizeof(topic), PSTR("cmnd/%s/EVENT"), device_groups[power_button_index].group_name);
|
||||||
MqttPublish(topic);
|
MqttPublish(topic);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user