Skip to content

solid green when the battery over 98% in charging mode#3768

Merged
beastoin merged 2 commits into
BasedHardware:mainfrom
TuEmb:TuEmb/full_charge_led
Dec 15, 2025
Merged

solid green when the battery over 98% in charging mode#3768
beastoin merged 2 commits into
BasedHardware:mainfrom
TuEmb:TuEmb/full_charge_led

Conversation

@TuEmb
Copy link
Copy Markdown
Contributor

@TuEmb TuEmb commented Dec 14, 2025

related to #3545

  • Updated solid green led when battery >= 98% on charging mode.
  • Send battery level every 10s instead of 30s as before.

@TuEmb TuEmb requested review from aaravgarg and beastoin December 14, 2025 19:43
@TuEmb
Copy link
Copy Markdown
Contributor Author

TuEmb commented Dec 14, 2025

image image

Discharge --> back to red/blue led status
https://github.com/user-attachments/assets/b67d8816-ed58-4567-bd6a-82f9e1cdef69

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the device's charging indicator to show a solid green LED when the battery level is 98% or higher. It also increases the frequency of battery level broadcasts from every 60 seconds to every 10 seconds. The changes are functionally correct, but I have identified a couple of areas for improvement. A global variable battery_percentage has been introduced, which is not thread-safe and creates undesirable coupling between modules; I've recommended an alternative approach using an accessor function. Additionally, a magic number is used for the battery threshold, which should be defined as a constant for better readability and maintainability.

Comment thread omi/firmware/omi/src/lib/core/transport.h
Comment thread omi/firmware/omi/src/main.c Outdated
@beastoin beastoin merged commit 4a233d4 into BasedHardware:main Dec 15, 2025
@beastoin
Copy link
Copy Markdown
Collaborator

lgtm @TuEmb

@TuEmb TuEmb deleted the TuEmb/full_charge_led branch December 15, 2025 04:21
Glucksberg pushed a commit to Glucksberg/omi-local that referenced this pull request Apr 28, 2026
…#3768)

* solid green when the battery over 98% in charging mode

* remove magic number
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.

2 participants