Skip to content

fix(alerts): não disparar CRITICAL quando não houver bateria - #9

Merged
armelingu merged 1 commit into
mainfrom
fix/alerts-no-battery
Aug 14, 2026
Merged

armelingu merged 1 commit into
mainfrom
fix/alerts-no-battery

Conversation

@armelingu

Copy link
Copy Markdown
Owner

Resumo

Em Mac desktop (ou quando o ioreg vem vazio) get_battery() devolve percent=0 e design_capacity_mah=0. O launchd a cada 15 min disparava "Battery CRITICAL at 0%! Plug in the charger now." Agora, sem DesignCapacity, mm alerts sai quieto. MacBook com bateria real em 0% continua alertando.

Tipo de mudança

  • fix — correção de bug
  • test — adiciona ou melhora testes
  • docs — documentação de usuário

Issues relacionadas

—

Saída

Antes (desktop / ioreg vazio):

Alerts fired: critical

Depois:

Nothing to notify.

Checklist

Notas para revisão

BatteryInfo.is_present() olha só design_capacity_mah > 0 — é o sinal estável de que o AppleSmartBattery existe. Próximos PRs: realocar LOGS_DIR, validação da CLI, interface ativa + não cachear IP público None.

Desktop ou ioreg vazio devolve percent=0 e design=0. O launchd a
cada 15 min avisava para plugar o carregador. Sem DesignCapacity
o comando agora sai quieto; MacBook em 0% real continua alertando.
@armelingu armelingu self-assigned this Aug 14, 2026
@armelingu
armelingu merged commit 6ccd664 into main Aug 14, 2026
15 checks passed
@armelingu
armelingu deleted the fix/alerts-no-battery branch August 14, 2026 23:33
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.

1 participant