Skip to content

Comments

Battery-indicator: add color based voltage level indicator#2273

Merged
ArturoManzoli merged 1 commit intobluerobotics:masterfrom
ArturoManzoli:allow-color-to-voltage-on-battery-indicator
Dec 10, 2025
Merged

Battery-indicator: add color based voltage level indicator#2273
ArturoManzoli merged 1 commit intobluerobotics:masterfrom
ArturoManzoli:allow-color-to-voltage-on-battery-indicator

Conversation

@ArturoManzoli
Copy link
Contributor

@ArturoManzoli ArturoManzoli commented Dec 4, 2025

  • Add color to voltage status indicator to the battery-indicator mini widget;
  • The feature is disabled by default because there are many different battery configurations. Users should set the voltage parameters according to their own battery pack. There is a disclaimer about this in the configuration dialog. Default values are related to the Blue Robotics 4s Li-Ion battery pack.
  • Critical level also makes the battery icon blink and pulse.
battery-levels

Closes #2272

@ArturoManzoli ArturoManzoli marked this pull request as draft December 4, 2025 20:36
@ArturoManzoli ArturoManzoli changed the title battery-indicator: add color based voltage level indicator [WIP] battery-indicator: add color based voltage level indicator Dec 4, 2025
@ArturoManzoli ArturoManzoli force-pushed the allow-color-to-voltage-on-battery-indicator branch from 1a6ab04 to 8b178d4 Compare December 8, 2025 13:52
@ArturoManzoli ArturoManzoli marked this pull request as ready for review December 8, 2025 13:52
@ArturoManzoli ArturoManzoli changed the title [WIP] battery-indicator: add color based voltage level indicator Battery-indicator: add color based voltage level indicator Dec 8, 2025
Comment on lines 237 to 246
const voltageToColorScheme = useBlueOsStorage<Record<BatteryLevel, string>>(
'cockpit-user-voltage-color-scheme',
defaultBatteryLevelColorScheme
)

const userBatteryThresholds = useBlueOsStorage<BatteryLevelThresholds>(
'cockpit-user-battery-levels',
defaultBatteryLevelThresholds
)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being a BlueOS Synced Storage, those will be global, meaning a user that operates both ROVs and Boats (which use different batteries with different voltage levels) are forced to have a single map of levels to colors.

I think the correct approach here is to put those in the widget options instead, so it's tied to the profile, which is already tied to different vehicle types.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. It makes more sense

return 'unknown'
})

const currentBatteryColor = computed(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I have the "Use voltage to color scheme" disabled, it was supposed to be transparent, right? I think there might be a bug there:

Image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@ArturoManzoli ArturoManzoli force-pushed the allow-color-to-voltage-on-battery-indicator branch from 8b178d4 to 9eb683f Compare December 9, 2025 21:41
@ArturoManzoli ArturoManzoli merged commit b756add into bluerobotics:master Dec 10, 2025
16 of 21 checks passed
@ES-Alexander ES-Alexander added the docs-needed Change needs to be documented label Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-needed Change needs to be documented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

frontend: Battery indicator mini widget should change colors based on voltage levels

3 participants