Last active
December 4, 2020 00:53
-
-
Save jjmilburn/30aee50eec45bf6f2eccf87ef6dce30b to your computer and use it in GitHub Desktop.
Generating dlight unit keycode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Generating dlight unit keycode | |
#dlight server index is unknown | |
Angaza index is X* | |
get_dlight_server_latest_token_data -> unit number exists on dlight server? | |
unit number exists on dlight server? | |
yes? -> dlight latest token index is X minus 1 or None? | |
no? -> Raise error require ticket to add unit on dlight side | |
dlight latest token index is X minus 1 or None? | |
yes? -> dlight_create_token_with_id_x | |
no? -> is dlight server index and token value equal to Angaza index and requested value? | |
dlight_create_token_with_id_x | |
success -> store token and update Angaza index to token index | |
failure -> Angaza index is X | |
is dlight server index and token value equal to Angaza index and requested value? | |
yes? -> store token and update Angaza index to token index | |
no? -> log warning of mismatch but continue | |
# Might include a history of all recent keycodes for easy reference | |
log warning of mismatch but continue | |
always -> store token and update Angaza index to token index | |
Raise error require ticket to add unit on dlight side | |
store token and update Angaza index to token index |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function render(model){ | |
let current_state_name = model.active_states[0].name; | |
return $("h1", | |
{style: {color: "darkBlue"}}, | |
`The current state is: ${current_state_name}`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment