Skip to content

Commit 6818099

Browse files
robgee86pennam
authored andcommitted
Add update timezone command support
1 parent 00fa53f commit 6818099

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/ArduinoIoTCloudTCP.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,13 @@ void ArduinoIoTCloudTCP::handleMessage(int length)
421421
}
422422
break;
423423

424+
case CommandId::TimezoneCommandDownId:
425+
{
426+
DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s [%d] timezone update received", __FUNCTION__, millis());
427+
_thing.handleMessage((Message*)&command);
428+
}
429+
break;
430+
424431
case CommandId::LastValuesUpdateCmdId:
425432
{
426433
DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s [%d] last values received", __FUNCTION__, millis());

src/ArduinoIoTCloudThing.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ void ArduinoCloudThing::update() {
7676
nextState = State::Connected;
7777
}
7878
break;
79+
80+
/* We have received a timezone update */
81+
case TimezoneCommandDownId:
82+
{
83+
TimezoneCommandDown * cmd = (TimezoneCommandDown *)_command;
84+
TimeService.setTimeZoneData(cmd->params.offset, cmd->params.until);
85+
}
86+
break;
7987

8088
/* We have received a reset command */
8189
case ResetCmdId:

0 commit comments

Comments
 (0)