tuya: Add SetOption22 to select if brightness-commands from faceplate should be ignored while powered off

This commit is contained in:
Joel Stein 2018-11-06 20:06:25 +01:00
parent aa148f67a3
commit 134a10d2c4
2 changed files with 1 additions and 2 deletions

View File

@ -729,7 +729,6 @@ void MqttDataHandler(char* topic, byte* data, unsigned int data_len)
case 6: // mqtt_button_retain (CMND_BUTTONRETAIN) case 6: // mqtt_button_retain (CMND_BUTTONRETAIN)
case 7: // mqtt_switch_retain (CMND_SWITCHRETAIN) case 7: // mqtt_switch_retain (CMND_SWITCHRETAIN)
case 9: // mqtt_sensor_retain (CMND_SENSORRETAIN) case 9: // mqtt_sensor_retain (CMND_SENSORRETAIN)
case 22: // mqtt_serial (SerialSend and SerialLog)
case 23: // mqtt_serial_raw (SerialSend) case 23: // mqtt_serial_raw (SerialSend)
case 25: // knx_enabled (Web config) case 25: // knx_enabled (Web config)
case 27: // knx_enable_enhancement (Web config) case 27: // knx_enable_enhancement (Web config)

View File

@ -207,7 +207,7 @@ void TuyaPacketProcess()
} }
tuya_new_dim = round(tuya_buffer[13] * (100. / 255.)); tuya_new_dim = round(tuya_buffer[13] * (100. / 255.));
if((power || bitRead(Settings.flag.data, 20)) && (tuya_new_dim > 0) && (abs(tuya_new_dim - Settings.light_dimmer) > 1)) { if((power || bitRead(Settings.flag.data, 22)) && (tuya_new_dim > 0) && (abs(tuya_new_dim - Settings.light_dimmer) > 1)) {
snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_DIMMER " %d"), tuya_new_dim ); snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_DIMMER " %d"), tuya_new_dim );