mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-30 14:16:32 +00:00
PS_16_DZ: further optimization
This commit is contained in:
parent
6825b78153
commit
49403243d5
@ -55,14 +55,15 @@ void PS16DZSendCommand(char type = 0, uint8_t value = 0)
|
|||||||
snprintf_P(ps16dz_tx_buffer, PS16DZ_BUFFER_SIZE, PSTR( "AT+SEND=ok"));
|
snprintf_P(ps16dz_tx_buffer, PS16DZ_BUFFER_SIZE, PSTR( "AT+SEND=ok"));
|
||||||
break;
|
break;
|
||||||
case PS16DZ_TYPE_PWR:
|
case PS16DZ_TYPE_PWR:
|
||||||
snprintf_P(ps16dz_tx_buffer, PS16DZ_BUFFER_SIZE, PSTR( "AT+UPDATE=\"sequence\":\""));
|
|
||||||
printTimestamp();
|
|
||||||
snprintf_P(ps16dz_tx_buffer, PS16DZ_BUFFER_SIZE, PSTR( "%s\",\"switch\":\"%s\""), ps16dz_tx_buffer, value?"on":"off");
|
|
||||||
break;
|
|
||||||
case PS16DZ_TYPE_DIM:
|
case PS16DZ_TYPE_DIM:
|
||||||
snprintf_P(ps16dz_tx_buffer, PS16DZ_BUFFER_SIZE, PSTR( "AT+UPDATE=\"sequence\":\""));
|
snprintf_P(ps16dz_tx_buffer, PS16DZ_BUFFER_SIZE, PSTR( "AT+UPDATE=\"sequence\":\""));
|
||||||
printTimestamp();
|
printTimestamp();
|
||||||
|
if ( type == PS16DZ_TYPE_PWR) {
|
||||||
|
snprintf_P(ps16dz_tx_buffer, PS16DZ_BUFFER_SIZE, PSTR( "%s\",\"switch\":\"%s\""), ps16dz_tx_buffer, value?"on":"off");
|
||||||
|
}
|
||||||
|
else if ( type == PS16DZ_TYPE_DIM) {
|
||||||
snprintf_P(ps16dz_tx_buffer, PS16DZ_BUFFER_SIZE, PSTR( "%s\",\"bright\":%d"), ps16dz_tx_buffer, round(value * (100. / 255.)));
|
snprintf_P(ps16dz_tx_buffer, PS16DZ_BUFFER_SIZE, PSTR( "%s\",\"bright\":%d"), ps16dz_tx_buffer, round(value * (100. / 255.)));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user