From d573f7641a33ff31726787b5d8cb7bad65c9d5dc Mon Sep 17 00:00:00 2001 From: Joel Stein Date: Fri, 9 Nov 2018 01:28:11 +0100 Subject: [PATCH] tuya: formatting --- sonoff/xdrv_16_tuyadimmer.ino | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sonoff/xdrv_16_tuyadimmer.ino b/sonoff/xdrv_16_tuyadimmer.ino index 71f5374d8..52b1450a5 100644 --- a/sonoff/xdrv_16_tuyadimmer.ino +++ b/sonoff/xdrv_16_tuyadimmer.ino @@ -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]); }