tuya: formatting

This commit is contained in:
Joel Stein 2018-11-09 01:28:11 +01:00
parent 3332ab01a1
commit d573f7641a
1 changed files with 4 additions and 3 deletions

View File

@ -140,11 +140,11 @@ void LightSerialDuty(uint8_t duty)
duty = 25; // dimming acts odd below 25(10%) - this mirrors the threshold set on the faceplate itself
}
TuyaSendValue(Settings.param[P_TUYA_DIMMER_ID], duty);
snprintf_P(log_data, sizeof(log_data), PSTR( "TYA: Send Serial Packet Dim Value=%d (id=%d)"), duty, Settings.param[P_TUYA_DIMMER_ID]);
AddLog(LOG_LEVEL_DEBUG);
TuyaSendValue(Settings.param[P_TUYA_DIMMER_ID], duty);
} else {
tuya_ignore_dim = false; // reset flag
@ -156,6 +156,7 @@ void LightSerialDuty(uint8_t duty)
void TuyaRequestState(){
if(TuyaSerial) {
// Get current status of MCU
snprintf_P(log_data, sizeof(log_data), "TYA: Request MCU state");
AddLog(LOG_LEVEL_DEBUG);
@ -325,7 +326,7 @@ void TuyaSerialInput()
else if ((tuya_cmd_status == 3) && (tuya_byte_counter == (6 + tuya_data_len)) && (tuya_cmd_checksum == serial_in_byte)){ // Compare checksum and process packet
tuya_buffer[tuya_byte_counter++] = serial_in_byte;
snprintf_P(log_data, sizeof(log_data), PSTR("TYA: Received Packet: \""));
snprintf_P(log_data, sizeof(log_data), PSTR("TYA: Rcvd Packet: \""));
for (int i = 0; i < tuya_byte_counter; i++) {
snprintf_P(log_data, sizeof(log_data), PSTR("%s%02x"), log_data, tuya_buffer[i]);
}