Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Commit

Permalink
Configuration of display refresh timeout and wrist flick through conf…
Browse files Browse the repository at this point in the history
…ig JSON
  • Loading branch information
Arjan Schrijver committed Jul 17, 2021
1 parent 8032eff commit 71374ce
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Then, run the following commands in the checked out repository:
- [X] Layout JSON support
- [X] Partial display update
- [X] Wrist flick functionality
- [X] Configurability of regular and custom functionality through config JSON
- [ ] Complications/widgets
- [X] Date / day of week
- [X] Weather
Expand All @@ -71,7 +72,6 @@ Then, run the following commands in the checked out repository:
- [ ] Custom text

## Ideas for future exploration
- [ ] Configurability of regular and custom functionality through config JSON
- [ ] Timed backgrounds
- [ ] Navigation instructions on watchface (from OsmAnd?)
- [ ] Multiple configs (thus, watchfaces) switchable with physical button
Expand Down
48 changes: 44 additions & 4 deletions open_source_watchface.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ return {
full_refresh_needed: false,
time_telling_enabled: true,
wrist_flick_display_timeout: 5000,
wrist_flick_hands_timeout: 3000,
wrist_flick_hands_timeout: 2200,
wrist_flick_hands_relative: true,
wrist_flick_move_hour: 360,
wrist_flick_move_minute: -360,
init: function() {
for (var key in this.config.layout) {
var layout = this.config.layout[key];
Expand All @@ -32,6 +35,43 @@ return {
}
}
}
if (this.config.config != undefined) {
for (var key in this.config.config) {
var value = this.config.config[key];
switch (key) {
case "timeout_display_partial":
if (typeof value === 'number') {
this.timeout_partial_display_update = value;
}
break;
case "timeout_display_full":
if (typeof value === 'number') {
this.timeout_full_display_update = value;
}
break;
case "wrist_flick_hands_relative":
if (typeof value === "boolean") {
this.wrist_flick_hands_relative = value;
}
break;
case "wrist_flick_move_hour":
if (typeof value === 'number') {
this.wrist_flick_move_hour = value;
}
break;
case "wrist_flick_move_minute":
if (typeof value === 'number') {
this.wrist_flick_move_minute = value;
}
break;
case "wrist_flick_duration":
if (typeof value === 'number') {
this.wrist_flick_hands_timeout = value;
}
break;
}
}
}
},
handler: function(event, response) {
var redraw_needed = false;
Expand Down Expand Up @@ -97,9 +137,9 @@ return {
disable_time_telling();
start_timer(this.node_name, 'hands', this.wrist_flick_hands_timeout);
response.move = {
h: 360,
m: -360,
is_relative: true,
h: this.wrist_flick_move_hour,
m: this.wrist_flick_move_minute,
is_relative: this.wrist_flick_hands_relative,
};
this.time_telling_enabled = false;
}
Expand Down

0 comments on commit 71374ce

Please sign in to comment.