COMMENT
Sleep Widget
shortcut by veredictum
Version:0.6.4;
COMMENT
To run setup, go to the details (...) menu and tap “Customize shortcut...”
COMMENT
Set value below to enable Charty
0 = disabled
1 = enabled
2 = ask each time
NUMBER
1

Number
VARIABLES
Set variable
ChartyEnabled
to
Number
COMMENT
Enter comment...
COMMENT
Advanced configuration options
DICTIONARY

Dictionary
VARIABLES
Set variable
UserConfig
to
Dictionary
COMMENT
Set value below to return to Springboard after running.
1 = Return to Springboard
0 = disabled
NUMBER
UserConfig

Number
VARIABLES
Set variable
SpringboardEnabled
to
Number
COMMENT
Set the value below to enable update checking.
1 = enabled
0 = disabled
NUMBER
UserConfig

Number
VARIABLES
Set variable
UpdatesEnabled
to
Number
COMMENT
Set the value below to enable resting heart rate on the chart.
1 = enabled
0 = disabled
NUMBER
UserConfig

Number
VARIABLES
Set variable
RestingEnabled
to
Number
COMMENT
Set the value below to enable the motion series on the chart.
1 = enabled
0 = disabled
NUMBER
UserConfig

Number
VARIABLES
Set variable
MotionEnabled
to
Number
COMMENT
Set the value below to enable the heart rate moving average series.
1 = enabled
0 = disabled
NUMBER
UserConfig

Number
VARIABLES
Set variable
HeartAverageEnabled
to
Number
COMMENT
Set the value below to enable the initial menu.
1 = enabled
0 = disabled
NUMBER
UserConfig

Number
VARIABLES
Set variable
MenuEnabled
to
Number
COMMENT
Set the value below to enable notifications.
1 = enabled
0 = disabled
NUMBER
UserConfig

Number
VARIABLES
Set variable
NotificationsEnabled
to
Number
COMMENT
Set the value below to show the report before quitting.
1 = enabled
0 = disabled
NUMBER
UserConfig

Number
VARIABLES
Set variable
ShowReport
to
Number
COMMENT
Set the value below to enable the noise series on the chart.
1 = enabled
0 = disabled
NUMBER
UserConfig

Number
VARIABLES
Set variable
NoiseEnabled
to
Number
COMMENT
Set the value below to enable the motion average series on the chart.
1 = enabled
0 = disabled
NUMBER
0

Number
VARIABLES
Set variable
MotionAvgEnabled
to
Number
COMMENT
Set the value below to enable the sleep quality series on the chart.
1 = enabled
0 = disabled
NUMBER
UserConfig

Number
VARIABLES
Set variable
SleepQualityEnabled
to
Number
COMMENT
Set the value below to enable the blue sleep background on the chart.
1 = enabled
0 = disabled
NUMBER
UserConfig

Number
VARIABLES
Set variable
BackgroundEnabled
to
Number
COMMENT
Shortcut meta information
DICTIONARY

Dictionary
VARIABLES
Set variable
Meta
to
Dictionary
DICTIONARY

Dictionary
VARIABLES
Set variable
Config
to
Dictionary
SCRIPTING
Get type of
Config

Type
VARIABLES
Set variable
DictionaryType
to
Type
TEXT
Text

Text
SCRIPTING
Get type of
Text

Type
VARIABLES
Set variable
TextType
to
Type
SCRIPTING
Get numbers from
Config

Numbers
VARIABLES
Set variable
PerfLog
to
Numbers
SCRIPTING
If
ChartyEnabled
is
1
NUMBER
3

Number
VARIABLES
Set variable
ChartyEnabled
to
Number
SCRIPTING
Otherwise
SCRIPTING
End If

If Result
SCRIPTING
Get type of
Shortcut Input

Type
SCRIPTING
If
Type
is
DictionaryType
COMMENT
Process input
SCRIPTING
Count
Characters
in
Shortcut Input

Count
SCRIPTING
If
Count
is greater than
0
SCRIPTING
Otherwise
SCRIPTING
Get type of
Shortcut Input

Type
SCRIPTING
If
Type
is
TextType
CALENDAR
Get dates from
Shortcut Input

Dates
VARIABLES
Set variable
ReportDate
to
Dates
NUMBER
0

Number
VARIABLES
Set variable
SpringboardEnabled
to
Number
NUMBER
0

Number
VARIABLES
Set variable
ShowReport
to
Number
SCRIPTING
Otherwise
SCRIPTING
End If

If Result
SCRIPTING
End If

If Result
SCRIPTING
Count
Characters
in
Shortcut Input

Count
SCRIPTING
If
Count
is greater than
0
SCRIPTING
Get numbers from
Shortcut Input

Numbers
SCRIPTING
If
Numbers
is less than or equal to
0
NUMBER
0

Number
SCRIPTING
Otherwise
NUMBER
1

Number
SCRIPTING
End If

If Result
VARIABLES
Set variable
ShowReport
to
If Result
SCRIPTING
Otherwise
SCRIPTING
End If

If Result
SCRIPTING
Count
Characters
in
Shortcut Input

Count
SCRIPTING
If
Count
is greater than
0
SCRIPTING
Get numbers from
Shortcut Input

Numbers
SCRIPTING
If
Numbers
is less than or equal to
0
NUMBER
0

Number
SCRIPTING
Otherwise
NUMBER
1

Number
SCRIPTING
End If

If Result
VARIABLES
Set variable
NotificationsEnabled
to
If Result
SCRIPTING
Otherwise