Skip to content

Conversation

Ricc68
Copy link
Contributor

@Ricc68 Ricc68 commented May 6, 2025

If the battery of a battery powered device is too low to safely complete a firmware update there's no information on the OTA page.
I've got this same situation with my devices and I did not notice that battery was too low because I went straight to the OTA page.
See my conversation with @Nerivec in #27098.

The icon is shown only when the battery is < 50% or is low or is battery_low.
I wanted to keep the code as much clean as possible so I have implemented a PowerSourceOTA that renders the danger icon.
The icon is not a red battery icon but a red circle with exclamation mark because I did not want to confuse the user with a red battery icon in this page when, for example at 49%, the icon in the device-page is dark grey indicating normal status of the battery.
Hoovering with the mouse over the icon shows a clear explanation message.
I have called the icon rendering at the end of the device line in the OTA page only if :

  • the device is a battery device
  • the above conditions are met
  • a firmware update is available for that device

In all other conditions the icon is not rendered.

The example page looks like this:

immagine

@Nerivec @Koenkk @nurikk please review and comment what can be done better or requires more attention on my side.

@Ricc68 Ricc68 changed the title feat: add a danger icon to OTA page for battery devices when battery is too low to run an update feat: add a danger icon to OTA page for battery devices when battery is too low to safely run an update May 6, 2025
@Ricc68
Copy link
Contributor Author

Ricc68 commented May 10, 2025

I thought that the warning icon is better than the danger icon in this scenario as actually we are just issuing a warning.
The icon looks less scary but still informative:

immagine

@Ricc68 Ricc68 changed the title feat: add a danger icon to OTA page for battery devices when battery is too low to safely run an update feat: add a warning icon to OTA page for battery devices when battery is too low to safely run an update May 10, 2025
@Koenkk
Copy link
Collaborator

Koenkk commented May 10, 2025

@Nerivec does it make sense for this to go in https://github.com/Nerivec/zigbee2mqtt-windfront?

@Nerivec
Copy link
Contributor

Nerivec commented May 10, 2025

Yes, I planned on adding something similar too.

@Koenkk Koenkk merged commit ed87878 into nurikk:dev May 11, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants