diff --git a/tasmota/tasmota_support/support_button _v3.ino b/tasmota/tasmota_support/support_button _v3.ino index ca3abed18..5379d849c 100644 --- a/tasmota/tasmota_support/support_button _v3.ino +++ b/tasmota/tasmota_support/support_button _v3.ino @@ -224,13 +224,13 @@ void ButtonInit(void) { // Button.last_state[i] = digitalRead(Pin(GPIO_KEY1, i)); // Set global now so doesn't change the saved power state on first button check Button.last_state[i] = (digitalRead(Pin(GPIO_KEY1, i)) != bitRead(Button.inverted_mask, i)); } - Button.virtual_state[i] = Button.last_state[i]; } #ifdef USE_ADC else if (PinUsed(GPIO_ADC_BUTTON, i) || PinUsed(GPIO_ADC_BUTTON_INV, i)) { Button.present++; } #endif // USE_ADC + Button.virtual_state[i] = Button.last_state[i]; } if (Button.present) { Button.first_change = true; diff --git a/tasmota/tasmota_support/support_switch.ino b/tasmota/tasmota_support/support_switch.ino index 485f932d9..7a3f01dae 100644 --- a/tasmota/tasmota_support/support_switch.ino +++ b/tasmota/tasmota_support/support_switch.ino @@ -197,7 +197,7 @@ void SwitchInit(void) { Switch.present = 0; for (uint32_t i = 0; i < MAX_SWITCHES; i++) { - Switch.last_state[i] = 1; // Init global to virtual switch state; + Switch.last_state[i] = NOT_PRESSED; // Init global to virtual switch state; if (PinUsed(GPIO_SWT1, i)) { Switch.present++; #ifdef ESP8266 diff --git a/tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino b/tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino index c6ce2ba9c..bb0111882 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino @@ -266,9 +266,9 @@ void EnergyUpdateToday(void) { } if (delta_sum_balanced > 0) { - Energy.daily_sum_import_balanced += (float) delta_sum_balanced / 100000; + Energy.daily_sum_import_balanced += (float)delta_sum_balanced / 100000; } else { - Energy.daily_sum_export_balanced += (float) abs(delta_sum_balanced) / 100000; + Energy.daily_sum_export_balanced += (float)abs(delta_sum_balanced) / 100000; } if (RtcTime.valid){ // We calc the difference only if we have a valid RTC time.