Skip to content

Commit

Permalink
Add command Power0 0/1/2/Off/On/Toggle to control all power outputs a…
Browse files Browse the repository at this point in the history
…t once

Add command Power0 0/1/2/Off/On/Toggle to control all power outputs at once (#6340)
  • Loading branch information
arendst committed Sep 3, 2019
1 parent 41f76c5 commit 34eed71
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions sonoff/_changelog.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Add 'sonoff-ir' pre-packaged IR-dedicated firmware and 'sonoff-ircustom' to customize firmware with IR Full protocol support
* Add Zigbee support phase 2 - cc2530 initialization and basic ZCL decoding
* Add driver USE_SDM120_2 with Domoticz P1 Smart Meter functionality as future replacement for USE_SDM120 - Pls test and report
* Add command Power0 0/1/2/Off/On/Toggle to control all power outputs at once (#6340)
*
* 6.6.0.8 20190827
* Add Tuya Energy monitoring by Shantur Rathore
Expand Down
11 changes: 10 additions & 1 deletion sonoff/support_command.ino
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,19 @@ void CmndPower(void)
{
if ((XdrvMailbox.index > 0) && (XdrvMailbox.index <= devices_present)) {
if ((XdrvMailbox.payload < 0) || (XdrvMailbox.payload > 4)) { XdrvMailbox.payload = 9; }
// Settings.flag.device_index_enable = user_index;
// Settings.flag.device_index_enable = XdrvMailbox.usridx;
ExecuteCommandPower(XdrvMailbox.index, XdrvMailbox.payload, SRC_IGNORE);
mqtt_data[0] = '\0';
}
else if (0 == XdrvMailbox.index) {
if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 2)) {
if (2 == XdrvMailbox.payload) {
XdrvMailbox.payload = (power) ? 0 : 1;
}
SetAllPower(XdrvMailbox.payload, SRC_IGNORE);
mqtt_data[0] = '\0';
}
}
}

void CmndStatus(void)
Expand Down

0 comments on commit 34eed71

Please sign in to comment.