Skip to content

Commit

Permalink
Add option CM_BLINK_DONT_MESS_WITH_ME
Browse files Browse the repository at this point in the history
If you prefer to manage blinkup out of the ConnectionManager
  • Loading branch information
Guillaume committed Dec 17, 2020
1 parent dafcecd commit 52d00f3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ConnectionManager.lib.nut
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const CM_BLINK_ALWAYS = 0;
const CM_BLINK_NEVER = 1;
const CM_BLINK_ON_CONNECT = 2;
const CM_BLINK_ON_DISCONNECT = 3;
const CM_BLINK_DONT_MESS_WITH_ME = 4;
const CM_FLUSH_TIMEOUT = 30;
const CM_START_NO_ACTION = 0;
const CM_START_CONNECTED = 1;
Expand Down Expand Up @@ -457,6 +458,11 @@ class ConnectionManager {

// Enables of disables BlinkUp based on _blinkupBehavior and _connected
function _setBlinkUpState() {
// If you prefer to manage blinkup out of the ConnectionManager
if (_blinkupBehavior == CM_BLINK_DONT_MESS_WITH_ME) {
return;
}

// If it's set to always blinkup
if (_blinkupBehavior == CM_BLINK_ALWAYS) {
imp.enableblinkup(true);
Expand Down

1 comment on commit 52d00f3

@gjanvier
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workaround for electricimp#35

Please sign in to comment.