Skip to content

Commit c36f5d8

Browse files
committed
make sure driver is enabled if connection chnages. If driver is enabled, and it can connect, connect!
1 parent 65fe00a commit c36f5d8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Flux/flxIoTArduino.h

+7
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@ class flxIoTArduino : public flxActionType<flxIoTArduino>, public flxIWriterJSON
237237

238238
_canConnect = bConnected;
239239

240+
if (!_isEnabled)
241+
return;
242+
240243
if (_canConnect)
241244
{
242245
if (cloudAPISecret().empty() || cloudAPISecret().empty())
@@ -293,6 +296,10 @@ class flxIoTArduino : public flxActionType<flxIoTArduino>, public flxIWriterJSON
293296
return;
294297

295298
_isEnabled = bEnabled;
299+
300+
// Can we connect?
301+
if (_canConnect)
302+
onConnectionChange(_canConnect);
296303
}
297304

298305
///---------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)