Skip to content

Instantly share code, notes, and snippets.

@jjmilburn
Last active December 4, 2020 00:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jjmilburn/30aee50eec45bf6f2eccf87ef6dce30b to your computer and use it in GitHub Desktop.
Save jjmilburn/30aee50eec45bf6f2eccf87ef6dce30b to your computer and use it in GitHub Desktop.
Generating dlight unit keycode
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
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