Skip to content
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

Merged
merged 2 commits into from Oct 9, 2019

Conversation

iantrich
Copy link
Member

@iantrich iantrich commented Oct 7, 2019

Fixes #3060

@iantrich iantrich self-assigned this Oct 7, 2019
@@ -86,19 +87,16 @@ class HuiPictureGlanceCard extends LitElement implements LovelaceCard {
}

protected shouldUpdate(changedProps: PropertyValues): boolean {
if (changedProps.has("_config")) {
if (hasConfigOrEntityChanged(this, changedProps)) {
Copy link
Member

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;
        }
}

Copy link
Member Author

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.

Copy link
Member

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 😛

👍

@iantrich
Copy link
Member Author

iantrich commented Oct 9, 2019

I think this should be in 0.100 as a bug fix if we do another release of beta

@bramkragten
Copy link
Member

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

@bramkragten bramkragten merged commit 0d77bda into home-assistant:dev Oct 9, 2019
@bramkragten bramkragten added this to the 0.100 milestone Oct 9, 2019
@iantrich
Copy link
Member Author

iantrich commented Oct 9, 2019

sure; didn't know if we were doing another release or not

@iantrich iantrich deleted the fix-glance-state_image branch October 9, 2019 19:59
@timdonovanuk
Copy link

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.

@iantrich
Copy link
Member Author

Don't comment on merged PRs. Open an issue

@github-actions github-actions bot locked and limited conversation to collaborators Jul 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

picture-glance state image refresh not working correctly
5 participants