Skip to content

Commit

Permalink
make sure driver is enabled if connection chnages. If driver is enabl…
Browse files Browse the repository at this point in the history
…ed, and it can connect, connect!
  • Loading branch information
gigapod committed Nov 16, 2023
1 parent 65fe00a commit c36f5d8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Flux/flxIoTArduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ class flxIoTArduino : public flxActionType<flxIoTArduino>, public flxIWriterJSON

_canConnect = bConnected;

if (!_isEnabled)
return;

if (_canConnect)
{
if (cloudAPISecret().empty() || cloudAPISecret().empty())
Expand Down Expand Up @@ -293,6 +296,10 @@ class flxIoTArduino : public flxActionType<flxIoTArduino>, public flxIWriterJSON
return;

_isEnabled = bEnabled;

// Can we connect?
if (_canConnect)
onConnectionChange(_canConnect);
}

///---------------------------------------------------------------------------------------
Expand Down

0 comments on commit c36f5d8

Please sign in to comment.