-
-
Notifications
You must be signed in to change notification settings - Fork 35.8k
Airthings ContextVar warning #149930
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
Airthings ContextVar warning #149930
Conversation
|
Hey there @Danielhiversen, 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
This PR fixes a deprecation warning in the Airthings integration by adding explicit config_entry parameter handling to address Home Assistant's move away from ContextVar usage.
- Updates the
AirthingsDataUpdateCoordinatorconstructor to accept aconfig_entryparameter - Passes the
config_entryexplicitly to the parentDataUpdateCoordinatorclass - Moves the
AirthingsConfigEntrytype definition from__init__.pytocoordinator.pyfor better organization
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| homeassistant/components/airthings/coordinator.py | Adds config_entry parameter to coordinator constructor and defines AirthingsConfigEntry type |
| homeassistant/components/airthings/init.py | Updates coordinator instantiation to pass config_entry and removes duplicate type definition |
| type AirthingsConfigEntry = ConfigEntry[AirthingsDataUpdateCoordinator] | ||
|
|
||
|
|
Copilot
AI
Aug 4, 2025
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.
The type alias creates a circular reference where AirthingsConfigEntry is defined in terms of AirthingsDataUpdateCoordinator, but AirthingsDataUpdateCoordinator also uses AirthingsConfigEntry in its constructor. Consider using ConfigEntry directly in the constructor parameter or defining the type alias after the class definition.
| type AirthingsConfigEntry = ConfigEntry[AirthingsDataUpdateCoordinator] |
Breaking change
Proposed change
Adding a
config_entryto the coordinatorType 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: