Merge pull request #4109 from chaosmaster/tuya-dimmer-ignore-dim

tuya-dimmer: ignore dim-values when powered off
This commit is contained in:
Theo Arends 2018-10-19 18:19:08 +02:00 committed by GitHub
commit a5c5ddaee6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -120,7 +120,7 @@ void TuyaPacketProcess()
AddLog(LOG_LEVEL_DEBUG); AddLog(LOG_LEVEL_DEBUG);
tuya_new_dim = round(serial_in_buffer[13] * (100. / 255.)); tuya_new_dim = round(serial_in_buffer[13] * (100. / 255.));
if((power || !Settings.light_dimmer ) && (tuya_new_dim > 0) && (abs(tuya_new_dim - Settings.light_dimmer) > 2)) { if((power) && (tuya_new_dim > 0) && (abs(tuya_new_dim - Settings.light_dimmer) > 2)) {
snprintf_P(log_data, sizeof(log_data), PSTR("TYA: Send CMND_DIMMER=%d"), tuya_new_dim ); snprintf_P(log_data, sizeof(log_data), PSTR("TYA: Send CMND_DIMMER=%d"), tuya_new_dim );
AddLog(LOG_LEVEL_DEBUG); AddLog(LOG_LEVEL_DEBUG);