Skip to content

Instantly share code, notes, and snippets.

@dangh
Last active December 26, 2018 09:02
Show Gist options
  • Save dangh/34c61b1a5d0d4702a909ca3164bb761b to your computer and use it in GitHub Desktop.
Save dangh/34c61b1a5d0d4702a909ca3164bb761b to your computer and use it in GitHub Desktop.
Configure CAP
Configure CAP
Instruct user to power on device and scan QR code
cancel -> Exit
Init
valid QR code -> Instruct user to connect wifi
wrong QR code -> Inform user about wrong QR code
Inform user about wrong QR code
OK -> Instruct user to power on device and scan QR code
Instruct user to connect wifi
Trying to connect
connected -> Set location
failed -> Ask user to retry connect
Ask user to retry connect
yes -> Trying to connect
cancel -> Exit
Set location
User input location
Next -> Call api to set location
Call api to set location
Call api set location
disconnect -> Ask user to connect Wifi in order to set location
success -> Set SSID-password
failed -> Ask user to retry Set location
Ask user to retry Set location
yes -> Call api set location
no -> Exit
Ask user to connect Wifi in order to set location
connected -> Call api set location
cancel -> Exit
Set SSID-password
User input SSID-password
Next -> Call api to set SSID-password
Call api to set SSID-password
Call api set SSID
disconnect -> Ask user to connect Wifi in order to set SSID
failed -> Ask user to retry Set SSID
success -> Wait to join new Wifi
Ask user to retry Set SSID
yes -> Call api set SSID
no -> Exit
Ask user to connect Wifi in order to set SSID
connected -> Call api set SSID
cancel -> Exit
Wait to join new Wifi
connected -> Congrats
failed -> Instruct user to troubleshoot
Instruct user to troubleshoot
Congrats
Sorry
Exit
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