Skip to content

Commit

Permalink
Merge pull request #60 from blinker-iot/dev
Browse files Browse the repository at this point in the history
update codes, fix toggle bug
  • Loading branch information
i3water authored Jun 19, 2018
2 parents 604473b + 218750d commit 0326e69
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Blinker/BlinkerApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ class BlinkerApi
bool toggle(const String & _tName)
{
int8_t num = checkNum(_tName, _Toggle, _tCount);
String state;
String state = "";

if (STRING_find_string_value(static_cast<Proto*>(this)->dataParse(), state, _tName)) {
_fresh = true;
Expand Down Expand Up @@ -1914,11 +1914,12 @@ class BlinkerApi
String state = data[_tName];

if (data.containsKey(_tName)) {
BLINKER_LOG2("STATE: ", state);
_fresh = true;
}
else {
state = "";
}
// else {
// state = "";
// }

if (state == BLINKER_CMD_ON) {
if( num == BLINKER_OBJECT_NOT_AVAIL ) {
Expand Down

0 comments on commit 0326e69

Please sign in to comment.