-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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 hass.components
and log warning if used inside custom component
#111508
Deprecate hass.components
and log warning if used inside custom component
#111508
Conversation
@bind_hass
and log warning if used inside custom component
ca3dc0a
to
afc262f
Compare
@bind_hass
and log warning if used inside custom componenthass.components
and log warning if used inside custom component
report( | ||
( | ||
f"accesses hass.components.{comp_name}." | ||
" This is deprecated and will stop working in Home Assistant 2024.6, it" |
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.
Lets make it 6 months (home-assistant/developers.home-assistant#2093 (review))
" This is deprecated and will stop working in Home Assistant 2024.6, it" | |
" This is deprecated and will stop working in Home Assistant 2024.9, it" |
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.
Was this forgotten?
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.
Yikes, yes, thought I've hit "Commit suggestion". Will create a PR.
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.
Fixed in #111903. Thanks for noticing it.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
dc54011
to
ad82e69
Compare
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!
…ponent (#111508) * Deprecate @bind_hass and log error if used inside custom component * Log also when accessing `hass.components` * Log warning only when `hass.components` is used * Change version * Process code review
Proposed change
Deprecate the use of(isn't used that much in custom integrations),@bind_hass
decoratorDeprecate the use of
hass.components
. The use within a custom component will issue a warning to the log.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
..coveragerc
.To help with the load of incoming pull requests: