Update xdrv_27_shutter.ino

This commit is contained in:
stefanbode 2022-12-08 18:36:17 +01:00 committed by GitHub
parent 27bbec0d40
commit c98164a400
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -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) {