Skip to content

Commit e37c79c

Browse files
committed
feat: add update timezone command support
1 parent 7571052 commit e37c79c

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/ArduinoIoTCloudTCP.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,13 @@ void ArduinoIoTCloudTCP::handleMessage(int length)
504504
}
505505
break;
506506

507+
case CommandId::TimezoneCommandDownId:
508+
{
509+
DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s [%d] timezone update received", __FUNCTION__, millis());
510+
_thing.handleMessage((Message*)&command);
511+
}
512+
break;
513+
507514
case CommandId::LastValuesUpdateCmdId:
508515
{
509516
DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s [%d] last values received", __FUNCTION__, millis());

src/ArduinoIoTCloudThing.cpp

+8
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)