Skip to content

Commit

Permalink
Expand timezone range to -13/13
Browse files Browse the repository at this point in the history
Fix timezone range from -12/12 to -13/13 (arendst#968)
  • Loading branch information
arendst committed Oct 5, 2017
1 parent 63207ac commit 383f077
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions sonoff/_releasenotes.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* 5.8.0g
* Fix inverted PWM index (#960)
* Fix some PWM related issues (#967)
* Fix timezone range from -12/12 to -13/13 (#968)
*
* 5.8.0f
* Set all saved power settings to Off when SetOption0 (SaveState) = 0 (#955)
Expand Down
2 changes: 1 addition & 1 deletion sonoff/sonoff.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,7 @@ void mqttDataCb(char* topic, byte* data, unsigned int data_len)
}
}
else if (!strcasecmp_P(type, PSTR(D_CMND_TIMEZONE))) {
if ((data_len > 0) && (((payload >= -12) && (payload <= 12)) || (99 == payload))) {
if ((data_len > 0) && (((payload >= -13) && (payload <= 13)) || (99 == payload))) {
sysCfg.timezone = payload;
}
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_TIMEZONE "\":%d}"), sysCfg.timezone);
Expand Down

0 comments on commit 383f077

Please sign in to comment.