Skip to content

feat(bq27441): Add clear error when battery is not connected. - #429

Merged
Charly-sketch merged 1 commit into
mainfrom
feat/bq27441-missing-battery-error
Sep 21, 2026
Merged

Charly-sketch merged 1 commit into
mainfrom
feat/bq27441-missing-battery-error

Conversation

@Charly-sketch

Copy link
Copy Markdown
Contributor

Description

Closes #428

Improve error handling when initializing the BQ27441 without a battery connected.

The BQ27441 is powered by the battery, so when no battery is connected the device is not available on the I2C bus. Previously, initialization resulted in an unclear OSError: [Errno 19] ENODEV.

The driver now checks whether the BQ27441 is present on the I2C bus before initialization and raises a clearer error:

BQ27441 not detected at I2C address 0x55. Make sure a battery is connected.

Changes

  • Check for the BQ27441 I2C address before initialization.
  • Raise a descriptive error when the device is not detected.
  • Preserve existing errors when the device is detected but another operation fails.

@Charly-sketch Charly-sketch self-assigned this Sep 21, 2026
@Charly-sketch Charly-sketch added bug Something isn't working enhancement New feature or request driver Concerne un driver spécifique labels Sep 21, 2026
@Charly-sketch
Charly-sketch merged commit 0132c28 into main Sep 21, 2026
10 checks passed
@Charly-sketch
Charly-sketch deleted the feat/bq27441-missing-battery-error branch September 21, 2026 09:55
semantic-release-updater Bot pushed a commit that referenced this pull request Sep 21, 2026
# [0.24.0](v0.23.2...v0.24.0) (2026-09-21)

### Features

* **bq27441:** Add clear error when battery is not connected. ([#429](#429)) ([0132c28](0132c28))
@semantic-release-updater

Copy link
Copy Markdown

🎉 This PR is included in version 0.24.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working driver Concerne un driver spécifique enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(bq27441): Error message when battery is not connected.

1 participant