Swap red / blue colorization for pedal balance source (#66)
Some checks failed
Build / build (push) Failing after 7m55s

This commit is contained in:
timklge 2025-08-24 20:21:08 +02:00 committed by GitHub
parent 4f7a508740
commit d5fae80d9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -71,8 +71,8 @@ tasks.register("generateManifest") {
"latestVersion" to android.defaultConfig.versionName, "latestVersion" to android.defaultConfig.versionName,
"latestVersionCode" to android.defaultConfig.versionCode, "latestVersionCode" to android.defaultConfig.versionCode,
"developer" to "github.com/timklge", "developer" to "github.com/timklge",
"description" to "Open-source extension that adds colored power or heart rate progress bars to the edges of the screen, similar to the LEDs on Wahoo computers", "description" to "Open-source extension that adds colored progress bars representing power, heart rate etc. to the edge of the screen, similar to the LED bars on older Wahoo computers",
"releaseNotes" to "* Fix gear bar refresh\n* Add german localization\n* Add gear data sources\n* Show zero value on bars to indicate sensor availability\n* Fix pedal balance values\n* Add pedal balance data source\n* Add option to split bars", "releaseNotes" to "* Swap red / blue colorization for pedal balance source\n* Fix gear bar refresh\n* Add german localization\n* Add gear data sources\n* Show zero value on bars to indicate sensor availability\n* Fix pedal balance values",
"screenshotUrls" to listOf( "screenshotUrls" to listOf(
"$baseUrl/powerbar_min.gif", "$baseUrl/powerbar_min.gif",
"$baseUrl/powerbar0.png", "$baseUrl/powerbar0.png",

View File

@ -227,11 +227,11 @@ class Window(
powerbar.drawMode = ProgressBarDrawMode.CENTER_OUT powerbar.drawMode = ProgressBarDrawMode.CENTER_OUT
if (streamData.powerBalanceLeft != null) { if (streamData.powerBalanceLeft != null) {
val value = remap((powerBalanceLeft ?: 50.0).coerceIn(0.0, 100.0), 40.0, 60.0, 100.0, 0.0) val value = remap(powerBalanceLeft.coerceIn(0.0, 100.0), 40.0, 60.0, 100.0, 0.0)
val percentLeft = (powerBalanceLeft ?: 50.0).roundToInt() val percentLeft = powerBalanceLeft.roundToInt()
@ColorRes val zoneColorRes = if (percentLeft < 50) { @ColorRes val zoneColorRes = if (percentLeft > 50) {
R.color.zone0 R.color.zone0
} else if (percentLeft == 50) { } else if (percentLeft == 50) {
R.color.zone1 R.color.zone1