Compare commits

...
3 Commits
4 changed files with 27 additions and 7 deletions
+4 -1
View File
@@ -8,7 +8,8 @@ All notable changes to this project will be documented in this file.
- Berry `bytes` methods `setbits`/`getbits` transposed to native and support for big endian (#24857)
- HASPmota ability to set default screen background on `p0b0` object (#24874)
- Matter virtual IR HVAC thermostat support (#24821)
- HASPmota and LVGL `stripes` widget
- HASPmota and LVGL `stripes` widget (#24907)
- MagicSwitch configurable masking window fixing problems with multiple false triggering (#24888)
### Breaking Changed
@@ -18,6 +19,8 @@ All notable changes to this project will be documented in this file.
### Fixed
- BLE EQ3 float output in mqtt messages regression from v15.4.0.2 (#24869)
- Default button/switch actions on builds without rules regression from v15.4.0.2 (#24871)
- PZEM/Modbus energy monitor Exception crash-loop on ESP8266 regression from v15.5.0 (#24883)
- Udisp SPI for mono color display (#24899)
### Removed
+6
View File
@@ -114,7 +114,11 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
## Changelog v15.5.0.1
### Added
- MagicSwitch configurable masking window fixing problems with multiple false triggering [#24888](https://github.com/arendst/Tasmota/issues/24888)
- Berry `bytes` methods `setbits`/`getbits` transposed to native and support for big endian [#24857](https://github.com/arendst/Tasmota/issues/24857)
- HASPmota ability to set default screen background on `p0b0` object [#24874](https://github.com/arendst/Tasmota/issues/24874)
- HASPmota and LVGL `stripes` widget [#24907](https://github.com/arendst/Tasmota/issues/24907)
- Matter virtual IR HVAC thermostat support [#24821](https://github.com/arendst/Tasmota/issues/24821)
### Breaking Changed
@@ -123,6 +127,8 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
### Fixed
- Default button/switch actions on builds without rules regression from v15.4.0.2 [#24871](https://github.com/arendst/Tasmota/issues/24871)
- PZEM/Modbus energy monitor Exception crash-loop on ESP8266 regression from v15.5.0 [#24883](https://github.com/arendst/Tasmota/issues/24883)
- Udisp SPI for mono color display [#24899](https://github.com/arendst/Tasmota/issues/24899)
- BLE EQ3 float output in mqtt messages regression from v15.4.0.2 [#24869](https://github.com/arendst/Tasmota/issues/24869)
### Removed
@@ -213,8 +213,8 @@ uint8_t TasmotaModbus::Send(uint8_t device_address, uint8_t function_code, uint1
write(frame, framepointer);
#ifdef TASMOTA_MODBUS_RX_ENABLE
delay(10); // add a delay to allow write buffers to empty
if (mb_rx_enable_pin > -1) {
delay(10); // allow write buffer to drain before re-enabling Rx
digitalWrite(mb_rx_enable_pin, LOW);
}
#endif // TASMOTA_MODBUS_RX_ENABLE
@@ -59,6 +59,7 @@ struct MAGICSWITCH_DATA {
uint32_t pulse_len; // measured pulse length
uint32_t min_pulse; // minimum pulse length
uint8_t switch_state; // switch state - count down for masking window
uint8_t masking_window_len; // masking window length (in 50 ms units)
uint8_t pin; // the GPIO of the input
uint8_t mode; // mode
int8_t key_offset; // index of the MagicSwitch in the list of Switches
@@ -100,7 +101,7 @@ void MagicSwitchLoop()
}
} else if (MagicSwitch->pulse_len) {
SwitchSetVirtualPinState(MagicSwitch->key_offset, 1);
MagicSwitch->switch_state = MAGICSWITCH_MASKING_WINDOW_LEN;
MagicSwitch->switch_state = MagicSwitch->masking_window_len;
AddLog(LOG_LEVEL_DEBUG, PSTR("MSW: length:%d, window:%d"), MagicSwitch->pulse_len, MagicSwitch->switch_state);
}
}
@@ -108,7 +109,7 @@ void MagicSwitchLoop()
void MagicSwitchSetPower(void) {
// It can happen that on relay switch, disturbances on the mains is falsy see as a MagicSwitch pulse
// This restart the masking windows on every power change to avoid that effect
MagicSwitch->switch_state = MAGICSWITCH_MASKING_WINDOW_LEN;
MagicSwitch->switch_state = MagicSwitch->masking_window_len;
}
/********************************************************************************************************
@@ -125,6 +126,7 @@ void MagicSwitchInit(void) {
MagicSwitch->mode = GetPin(MagicSwitch->pin) - AGPIO(GPIO_MAGIC_SWITCH); // Index 1 => mode 0, etc...
MagicSwitch->key_offset = -1; // means not yet configured
MagicSwitch->min_pulse = MAGICSWITCH_MIN_PULSE;
MagicSwitch->masking_window_len = MAGICSWITCH_MASKING_WINDOW_LEN;
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("MSW: pin:%d, mode:%d"), MagicSwitch->pin, MagicSwitch->mode);
@@ -148,12 +150,13 @@ bool MagicSwitchAddSwitch(void) {
* Commands
*/
const char kMagicSwitchCommands[] PROGMEM = "MagicSwitch|"
"Pulse"
const char kMagicSwitchCommands[] PROGMEM = "MagicSwitch|"
"Pulse|Window"
;
void (* const MagicSwitchCommand[])(void) PROGMEM = {
&CmndMagicSwitchPulse
&CmndMagicSwitchPulse,
&CmndMagicSwitchWindow
};
void CmndMagicSwitchPulse(void)
@@ -164,6 +167,14 @@ void CmndMagicSwitchPulse(void)
ResponseCmndNumber(MagicSwitch->min_pulse);
}
void CmndMagicSwitchWindow(void)
{
if ((XdrvMailbox.payload >= 1) && (XdrvMailbox.payload <= 255)) {
MagicSwitch->masking_window_len = XdrvMailbox.payload;
}
ResponseCmndNumber(MagicSwitch->masking_window_len);
}
/*********************************************************************************************\
* Interface
\*********************************************************************************************/