Skip to content
This repository has been archived by the owner on Feb 14, 2022. It is now read-only.

Commit

Permalink
Closes #67
Browse files Browse the repository at this point in the history
  • Loading branch information
ggoraa committed May 31, 2021
1 parent 27acea8 commit f2d3016
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added:
- Settings to change PWM coloring thresholds(when main arcs turns orange or red)

## [[2.2 Stable] - 29.05.2021](https://github.com/Wheellog/WheelLog.Garmin/releases/tag/2.2)

### Added:
Expand Down
3 changes: 3 additions & 0 deletions src/WheelLogCompanionApp.mc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ class WheelLogCompanionApp extends Application.AppBase {
AppStorage.runtimeCache["comm_disconnectionCountdown"] = 4;
AppStorage.runtimeCache["comm_lastResponseCode"] = 200;
AppStorage.runtimeCache["wheel_lastConnectionState"] = false;
AppStorage.runtimeCache["comm_wheelDisconnectionNoticeCountdown"] = 15;
AppStorage.runtimeCache["comm_appDisconnectionNoticeCountdown"] = 15;

WheelData.appUpdateTimer.start(method(:appUpdateTimerMethod), 500, true);
}

Expand Down
20 changes: 20 additions & 0 deletions src/util/TimerMethods.mc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,26 @@ function appUpdateTimerMethod() {
AppStorage.runtimeCache["wheel_lastConnectionState"] = WheelData.isWheelConnected;
}
}

if (AppStorage.runtimeCache["comm_wheelDisconnectionNoticeCountdown"] != 0 && WheelData.isWheelConnected == false) {
AppStorage.runtimeCache["comm_wheelDisconnectionNoticeCountdown"]--;
}

if (AppStorage.runtimeCache["comm_wheelDisconnectionNoticeCountdown"] == 0 && WheelData.isWheelConnected == false) {
AppStorage.runtimeCache["comm_wheelDisconnectionNoticeCountdown"] = 15;
if (Attention has :playTone) { Attention.playTone(Attention.TONE_LOUD_BEEP); }
if (Attention has :vibrate) { Attention.vibrate([ new Attention.VibeProfile(2000, 2000)]); }
}

if (AppStorage.runtimeCache["comm_appDisconnectionNoticeCountdown"] != 0 && WheelData.isWheelConnected == false) {
AppStorage.runtimeCache["comm_appDisconnectionNoticeCountdown"]--;
}

if (AppStorage.runtimeCache["comm_appDisconnectionNoticeCountdown"] == 0 && WheelData.isWheelConnected == false) {
AppStorage.runtimeCache["comm_appDisconnectionNoticeCountdown"] = 15;
if (Attention has :playTone) { Attention.playTone(Attention.TONE_LOUD_BEEP); }
if (Attention has :vibrate) { Attention.vibrate([ new Attention.VibeProfile(2000, 2000)]); }
}
}

function timerMethods_reconnectionAttemptResponse(responseCode, data) {
Expand Down

0 comments on commit f2d3016

Please sign in to comment.