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
picture-glance: check for entity state change #3949
picture-glance: check for entity state change #3949
Conversation
@@ -86,19 +87,16 @@ class HuiPictureGlanceCard extends LitElement implements LovelaceCard { | |||
} | |||
|
|||
protected shouldUpdate(changedProps: PropertyValues): boolean { | |||
if (changedProps.has("_config")) { | |||
if (hasConfigOrEntityChanged(this, changedProps)) { |
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 function is for a single entity
config not for entities
arrays. We might want to add a function for entities that replaced the logic under here on lines 96-112.
for (const entity of element._config.entities) {
if (
oldHass.states[entity.entity || entity] !== element.hass.states[entity.entity || entity]
) {
return true;
}
}
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.
Right, there is an optional entity
that is used for the state_image
that I'm checking here. I can open a separate PR for a common function as it would hit a few other cards.
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.
blegh to many entity/entities 😛
👍
I think this should be in 0.100 as a bug fix if we do another release of beta |
If you want something in 0.100, put the milestone on it |
sure; didn't know if we were doing another release or not |
FWIW, this doesn't seem fixed at all in HA 0.103.0- I still have the same issue as described by the first post in #3060. My camera goes from online to offline, and the picture-glance card shows a broken image, even after the camera comes back online. Only way to bring the glance image back is refreshing the UI. |
Don't comment on merged PRs. Open an issue |
Fixes #3060