mirror of https://github.com/arendst/Tasmota.git
Update xdrv_27_shutter.ino
This commit is contained in:
parent
27bbec0d40
commit
c98164a400
|
@ -1378,7 +1378,14 @@ void CmndShutterMode(void)
|
||||||
|
|
||||||
void CmndShutterRelay(void)
|
void CmndShutterRelay(void)
|
||||||
{
|
{
|
||||||
if ((XdrvMailbox.index > 0) && (XdrvMailbox.index <= MAX_SHUTTERS)) {
|
if (!XdrvMailbox.usridx && !XdrvMailbox.data_len) {
|
||||||
|
// {"ShutterRelay1":"1","ShutterRelay2":"3","ShutterRelay3":"5"}
|
||||||
|
Response_P(PSTR("{"));
|
||||||
|
for (uint32_t i = 0; i < TasmotaGlobal.shutters_present; i++) {
|
||||||
|
ResponseAppend_P(PSTR("%s\"" D_PRFX_SHUTTER D_CMND_SHUTTER_RELAY "%d\":\"%d\""), (i)?",":"", i+1,Settings->shutter_startrelay[i]);
|
||||||
|
}
|
||||||
|
ResponseAppend_P(PSTR("}"));
|
||||||
|
} else if ((XdrvMailbox.index > 0) && (XdrvMailbox.index <= MAX_SHUTTERS)) {
|
||||||
if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 64)) {
|
if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 64)) {
|
||||||
Settings->shutter_startrelay[XdrvMailbox.index -1] = XdrvMailbox.payload;
|
Settings->shutter_startrelay[XdrvMailbox.index -1] = XdrvMailbox.payload;
|
||||||
if (XdrvMailbox.payload > 0) {
|
if (XdrvMailbox.payload > 0) {
|
||||||
|
|
Loading…
Reference in New Issue