Skip to content

add defaultState option to set a fallback alarm panel state#22

Draft
cupracer wants to merge 1 commit intoAnamico:masterfrom
cupracer:make-default-state-configurable
Draft

add defaultState option to set a fallback alarm panel state#22
cupracer wants to merge 1 commit intoAnamico:masterfrom
cupracer:make-default-state-configurable

Conversation

@cupracer
Copy link
Contributor

@cupracer cupracer commented Jul 6, 2021

The alarm panel defaults to a hard-coded 0 state ("Home" mode), which immediately would result in an alarm after restarting Node-RED in case a "Home"-sensor triggers at this time.

I would like to avoid enabling the default use of persistent storage for global context variables. It would be sufficient for my environment to just start with a disabled alarm panel (state 3) instead of "Home"-mode (state 0).

To achieve this I extended the code to have a default/fallback state configurable instead of having it hard-coded to 0. It would be used whenever Node-RED is started without an existing global 'SecuritySystemCurrentState_' + node.nodeId variable.

This defaultState option as well defaults to 0, so it shouldn't disturb existing setups.

Note: For quite better solution to address this topic see #23 .

@cupracer cupracer marked this pull request as draft July 6, 2021 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant