-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
Deprecate async_add_hass_job #115061
Deprecate async_add_hass_job #115061
Conversation
# pylint: disable-next=protected-access | ||
self._hass._async_add_hass_job(job, event) |
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.
We only have 3 places left where this is called. We should try to get rid of them so we can deprecate this as well
homeassistant/components/matrix/__init__.py: EVENT_HOMEASSISTANT_START, handle_startup, run_immediately=False
homeassistant/components/rfxtrx/__init__.py: dr.EVENT_DEVICE_REGISTRY_UPDATED, _updated_device, run_immediately=False
homeassistant/helpers/event.py: run_immediately=False,
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.
event can be switched after #115160
If we can fix the other two we can deprecate run_immediately=False
and get rid of this completely in a future PR
codecov is likely going to fail. Directly covered lines in core: 667-684 are the new lines here for the report and test coverage was verified locally |
@@ -1458,7 +1510,8 @@ def _async_fire( | |||
except Exception: # pylint: disable=broad-except | |||
_LOGGER.exception("Error running job: %s", job) | |||
else: | |||
self._hass.async_add_hass_job(job, event) | |||
# pylint: disable-next=protected-access |
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.
This will go away in #115169
Proposed change
Deprecate
async_add_hass_job
In #113260 we deprecated
async_run_job
andasync_add_job
. As we no longer have integration usage ofasync_add_hass_job
we can deprecate it as well.async_run_hass_job
should be used instead.Type of change
Additional information
async_add_hass_job
developers.home-assistant#2140Checklist
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
..coveragerc
.To help with the load of incoming pull requests: