-
-
Notifications
You must be signed in to change notification settings - Fork 34.1k
Clean up core #10305
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
Clean up core #10305
Conversation
'post_pending_state', | ||
STATE_ALARM_ARMED_NIGHT)) | ||
state = self.hass.states.get(entity_id) | ||
assert state.attributes['post_pending_state'] == STATE_ALARM_ARMED_NIGHT |
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.
line too long (80 > 79 characters)
'post_pending_state', | ||
STATE_ALARM_ARMED_NIGHT)) | ||
state = self.hass.states.get(entity_id) | ||
assert state.attributes['post_pending_state'] == STATE_ALARM_ARMED_NIGHT |
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.
line too long (80 > 79 characters)
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.
Looks good. One question.
homeassistant/helpers/template.py
Outdated
"""Test if a state is a specific attribute.""" | ||
state_obj = self.hass.states.get(entity_id) | ||
return state_obj is not None and \ | ||
state_obj.attributes.get(name, None) == value |
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.
Why specify None
as default?
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.
Because I copied it from core. Fixed.
Description:
is_state_attr
fromhass.states
. This should never have been added. It's a helper method that has not much value in core. I've made sure that it is still available for templates.wait
variable fromhass.bus.async_fire
Breaking change:
hass.states.is_state_attr
has been removedwait
has been removed ofhass.bus.async_fire
Checklist:
If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass