Repository navigation
Conversation
011daa7 to
1d31059
Compare
(SwitchType can now be used for road shifter, TT shifter, etc.)
1d31059 to
fb57c8d
Compare
…rete levels (unknown/low/mid/high) instead of a percentage.
2334d30 to
cde9134
Compare
| <string name="text_signal">Signal</string> | ||
| <string name="text_connection_status">Connection Status</string> | ||
| <string name="text_battery">Battery</string> | ||
| <string name="text_main_battery">Main Battery</string> |
There was a problem hiding this comment.
Not really sure what to call this one: Main Battery/Central Battery/System Battery?
There was a problem hiding this comment.
Maybe Shifting Battery? Also not sure...
cde9134 to
6da6ac6
Compare
6da6ac6 to
fc0a411
Compare
valterc
left a comment
There was a problem hiding this comment.
This is great, thanks!
Looks good overall, some minor comments. Still need to give it a try in Karoo.
| lowBatteryRecords.filter { !it.alertedInRide }.forEach { alertRecord -> | ||
| alertRecord.alertedInRide = true | ||
| alertInRide(alertRecord) | ||
| } |
There was a problem hiding this comment.
Haven't tried it, how does it look when multiple wireless switches have low battery? Would it be better to send a single InRideAlert with all low battery switches like you do for the SystemNotification?
| <string name="summary_preference_ant_recording">Record all ANT events and data into a file for debugging</string> | ||
| <string name="summary_preference_fit_recording_device_info">Record identifiers of the Di2 device in use into the ride FIT file</string> | ||
| <string name="summary_preference_battery_notification">Show notifications when the shifting battery level is at or below a certain value</string> | ||
| <string name="summary_preference_battery_notification">Show notifications when the main battery level is at or below a certain value, or when a wireless switch battery is low</string> |
There was a problem hiding this comment.
| <string name="summary_preference_battery_notification">Show notifications when the main battery level is at or below a certain value, or when a wireless switch battery is low</string> | |
| <string name="summary_preference_battery_notification">Show notifications when the shifting battery level is at or below a certain value, or when a wireless switch battery is low</string> |
Maybe keep shifting battery?
| val stateLock = Any() | ||
| var state = ViewState() | ||
| val states = Channel<ViewState>(Channel.CONFLATED) | ||
|
|
||
| fun updateState(transform: (ViewState) -> ViewState) { | ||
| synchronized(stateLock) { | ||
| state = transform(state) | ||
| states.trySend(state) | ||
| } | ||
| } |
There was a problem hiding this comment.
| val stateLock = Any() | |
| var state = ViewState() | |
| val states = Channel<ViewState>(Channel.CONFLATED) | |
| fun updateState(transform: (ViewState) -> ViewState) { | |
| synchronized(stateLock) { | |
| state = transform(state) | |
| states.trySend(state) | |
| } | |
| } | |
| var state = ViewState() | |
| val states = Channel<ViewState>(Channel.CONFLATED) | |
| fun updateState(transform: (ViewState) -> ViewState) { | |
| state = transform(state) | |
| states.trySend(state) | |
| } |
Not sure why we need the synchronized?
| <LinearLayout | ||
| android:id="@+id/linearlayout_device_details_wireless_switch_batteries" | ||
| android:layout_width="match_parent" | ||
| android:layout_height="wrap_content" | ||
| android:orientation="vertical" /> |
There was a problem hiding this comment.
I'll give it a try, what is displayed for systems without wireless switches?
| <string name="text_signal">Signal</string> | ||
| <string name="text_connection_status">Connection Status</string> | ||
| <string name="text_battery">Battery</string> | ||
| <string name="text_main_battery">Main Battery</string> |
There was a problem hiding this comment.
Maybe Shifting Battery? Also not sure...
[Issue #313] This PR adds battery indicators and low-battery notifications/alerts for wireless switches.