Skip to content

Commit

Permalink
Merge pull request #502 from cobaltfish/Fix/IncludeTakeControlStateMa…
Browse files Browse the repository at this point in the history
…intain

Feature: include "take control" state when restoring / restarting
  • Loading branch information
visualapproach authored May 10, 2023
2 parents 11bfdcf + 21de76b commit 60185b0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Code/lib/BWC_unified/bwc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,14 @@ void BWC::_restoreStates() {
uint8_t flt = doc[F("FLT")];
uint8_t htr = doc[F("HTR")];
uint8_t tgt = doc[F("TGT")] | 20;
uint8_t god = doc[F("GOD")] ;
command_que_item item;
item.cmd = SETGODMODE;
item.val = god;
item.xtime = 0;
item.interval = 0;
item.text = "";
add_command(item);
item.cmd = SETUNIT;
item.val = unt;
item.xtime = 0;
Expand Down Expand Up @@ -1261,6 +1268,7 @@ void BWC::_saveStates() {
doc[F("HTR")] = cio->cio_states.heat;
doc[F("FLT")] = cio->cio_states.pump;
doc[F("TGT")] = cio->cio_states.target;
doc[F("GOD")] = cio->cio_states.godmode;

// Serialize JSON to file
if (serializeJson(doc, file) == 0) {
Expand Down

0 comments on commit 60185b0

Please sign in to comment.