Merge pull request #9348 from effelle/development

TuyaMCU update
This commit is contained in:
Theo Arends 2020-09-19 13:55:47 +02:00 committed by GitHub
commit 59070ebbd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -444,7 +444,6 @@ bool TuyaSetChannels(void)
if (LT_RGB != light_type) {
for (uint8_t i = 0; i <= idx; i++) {
if (Tuya.Snapshot[i] != Tuya.Levels[i]) {
if (i == 0 && LightMode && Tuya.ModeSet ) { noupd = true;}
if (!noupd) {
@ -457,6 +456,7 @@ bool TuyaSetChannels(void)
}
if (light_type >= LT_RGB) {
light_state.getHSB(&hue, &sat, &bri);
sat = changeUIntScale(sat, 0, 255, 0, 100);
bri = changeUIntScale(bri, 0, 255, 0, 100);
@ -1114,6 +1114,7 @@ bool Xdrv16(uint8_t function)
result = TuyaButtonPressed();
break;
case FUNC_EVERY_SECOND:
TuyaSetChannels();
if (TuyaSerial && Tuya.wifi_state != TuyaGetTuyaWifiState()) { TuyaSetWifiLed(); }
if (!Tuya.low_power_mode) {
Tuya.heartbeat_timer++;
@ -1131,9 +1132,9 @@ bool Xdrv16(uint8_t function)
}
if (Tuya.ignore_topic_timeout < millis()) { Tuya.SuspendTopic = false; }
break;
case FUNC_SET_CHANNELS:
result = TuyaSetChannels();
break;
// case FUNC_SET_CHANNELS:
// result = TuyaSetChannels();
// break;
case FUNC_COMMAND:
result = DecodeCommand(kTuyaCommand, TuyaCommand);
break;