Skip to content

fix: enhance device handling in MiniBrew sensor integration#17

Merged
stuartp44 merged 1 commit into
mainfrom
stu/fix_subscription
May 5, 2026
Merged

fix: enhance device handling in MiniBrew sensor integration#17
stuartp44 merged 1 commit into
mainfrom
stu/fix_subscription

Conversation

@stuartp44

Copy link
Copy Markdown
Owner

This pull request addresses issues with handling Device objects returned by the API in the MiniBrew Home Assistant integration, ensuring that both dictionary and object representations are processed correctly. The main changes improve robustness and compatibility when interacting with device data, preventing errors when the API returns Device instances instead of dictionaries.

Device data handling improvements:

  • Added the _device_to_dict helper function in sensor.py to consistently convert Device objects or other representations into dictionaries for reliable attribute access.
  • Updated all locations in sensor.py where device data is accessed (e.g., when checking the serial_number) to use _device_to_dict, ensuring compatibility with both dicts and Device objects. [1] [2] [3] [4] [5]

Bug fix:

  • Fixed an issue where the integration would fail if the API returned Device objects without setup errors, as noted in the changelog.

@stuartp44 stuartp44 added the preview Will create a preview release label May 5, 2026
@stuartp44 stuartp44 merged commit 44b4d19 into main May 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Will create a preview release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant