mirror of https://github.com/arendst/Tasmota.git
Fix single pin latching relay power on state
Fix single pin latching relay power on state (#18386)
This commit is contained in:
parent
65eb9142a2
commit
9f77cfd890
|
@ -6,8 +6,8 @@ All notable changes to this project will be documented in this file.
|
|||
## [12.5.0.1]
|
||||
### Added
|
||||
- Matter sensors Humidity, Pressure, Illuminance; optimize memory (#18441)
|
||||
- Command ``SetOption152 0/1`` to select two (default) or one pin bistable relay control (#18386)
|
||||
- Matter allow `Matter#Initialized` rule once the device is configured
|
||||
- Command ``SetOption152 0/1`` to select two (0 = default) pin bistable or one (1) pin latching relay control (#18386)
|
||||
- Matter allow `Matter#Initialized` rule once the device is configured (#18451)
|
||||
|
||||
### Breaking Changed
|
||||
|
||||
|
|
|
@ -112,8 +112,9 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
|
|||
|
||||
## Changelog v12.5.0.1
|
||||
### Added
|
||||
- Command ``SetOption152 0/1`` to select two (default) or one pin bistable relay control [#18386](https://github.com/arendst/Tasmota/issues/18386)
|
||||
- Command ``SetOption152 0/1`` to select two (0 = default) pin bistable or one (1) pin latching relay control [#18386](https://github.com/arendst/Tasmota/issues/18386)
|
||||
- Matter sensors Humidity, Pressure, Illuminance [#18441](https://github.com/arendst/Tasmota/issues/18441)
|
||||
- Matter allow `Matter#Initialized` rule once the device is configured [#18451](https://github.com/arendst/Tasmota/issues/18451)
|
||||
|
||||
### Breaking Changed
|
||||
|
||||
|
|
|
@ -254,7 +254,7 @@ struct TasmotaGlobal_t {
|
|||
void *log_buffer_mutex; // Control access to log buffer
|
||||
|
||||
power_t power; // Current copy of Settings->power
|
||||
power_t power_bistable; // Current state of single pin bistable power
|
||||
power_t power_latching; // Current state of single pin latching power
|
||||
power_t rel_inverted; // Relay inverted flag (1 = (0 = On, 1 = Off))
|
||||
power_t rel_bistable; // Relay bistable bitmap
|
||||
power_t last_power; // Last power set state
|
||||
|
@ -431,7 +431,7 @@ void setup(void) {
|
|||
TasmotaGlobal.global_state.data = 0xF; // Init global state (wifi_down, mqtt_down) to solve possible network issues
|
||||
TasmotaGlobal.enable_logging = 1;
|
||||
TasmotaGlobal.seriallog_level = LOG_LEVEL_INFO; // Allow specific serial messages until config loaded
|
||||
TasmotaGlobal.power_bistable = 0x80000000;
|
||||
TasmotaGlobal.power_latching = 0x80000000;
|
||||
|
||||
RtcRebootLoad();
|
||||
if (!RtcRebootValid()) {
|
||||
|
|
|
@ -320,12 +320,12 @@ void SetDevicePower(power_t rpower, uint32_t source) {
|
|||
bool update = true;
|
||||
if (bitRead(TasmotaGlobal.rel_bistable, port)) {
|
||||
if (Settings->flag6.bistable_single_pin) { // SetOption152 - (Power) Use single pin bistable
|
||||
if (0x80000000 == TasmotaGlobal.power_bistable) {
|
||||
TasmotaGlobal.power_bistable = TasmotaGlobal.power; // Init last known state
|
||||
if (0x80000000 == TasmotaGlobal.power_latching) {
|
||||
TasmotaGlobal.power_latching = TasmotaGlobal.power; // Init last known state
|
||||
}
|
||||
update = (bitRead(TasmotaGlobal.power_bistable, port) != state);
|
||||
update = (bitRead(TasmotaGlobal.power_latching, port) != state);
|
||||
if (update) {
|
||||
bitWrite(TasmotaGlobal.power_bistable, port, state);
|
||||
bitWrite(TasmotaGlobal.power_latching, port, state);
|
||||
bitSet(bistable, port);
|
||||
}
|
||||
|
||||
|
@ -418,6 +418,7 @@ void SetPowerOnState(void)
|
|||
} else {
|
||||
power_t devices_mask = POWER_MASK >> (POWER_SIZE - TasmotaGlobal.devices_present);
|
||||
if (ResetReasonPowerOn()) {
|
||||
TasmotaGlobal.power_latching = 0; // Single pin latching relay is powered off after re-applying power
|
||||
switch (Settings->poweronstate) {
|
||||
case POWER_ALL_OFF:
|
||||
case POWER_ALL_OFF_PULSETIME_ON:
|
||||
|
|
Loading…
Reference in New Issue