-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Move medcom_ble coordinator to separate module #148009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hey there @elafargue, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Moves the Medcom BLE update coordination logic into a dedicated module to prepare for runtime_data usage.
- Introduce
MedcomBleUpdateCoordinator
in a newcoordinator.py
- Refactor
async_setup_entry
in__init__.py
to use the new coordinator - Remove inline update logic in favor of the centralized coordinator
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
homeassistant/components/medcom_ble/coordinator.py | Added new MedcomBleUpdateCoordinator class to handle data updates |
homeassistant/components/medcom_ble/init.py | Refactored to use the new coordinator and removed inline update logic |
Comments suppressed due to low confidence (3)
homeassistant/components/medcom_ble/coordinator.py:1
- [nitpick] The module-level docstring is quite generic. Consider clarifying that this module provides the
MedcomBleUpdateCoordinator
for fetching BLE device data.
"""The Medcom BLE integration."""
homeassistant/components/medcom_ble/coordinator.py:1
- This new coordinator module doesn’t have corresponding unit tests. Please add tests covering successful data fetches and error handling (e.g.,
BleakError
scenarios).
"""The Medcom BLE integration."""
homeassistant/components/medcom_ble/coordinator.py:43
- [nitpick] Instantiating
MedcomBleDeviceData
on every update may be unnecessary if it's stateless. Consider creating it once in__init__
and reusing it to reduce allocations and centralize setup.
inspector = MedcomBleDeviceData(_LOGGER, self._elevation, self._is_metric)
All reactions
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @epenet 👍
../Frenck
Proposed change
SSIA, preliminary for runtime_data
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: