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

fix: avoid updates during shutdown #307

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

chemelli74
Copy link
Collaborator

No description provided.

Copy link
Owner

@wuwentao wuwentao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I'm not fully understand it.
anyway, is this possible to merge if self.hass.is_stopping and if not self.hass ?
if not possible, maybe we still can add a error or warning debug log in self.hass.is_stopping

@rokam
Copy link
Collaborator

rokam commented Sep 19, 2024

I do agree with @wuwentao
You need to check self.hass first

@chemelli74
Copy link
Collaborator Author

update is called by core, so hass is there at the time of invocation. It cannot happen it's not

@wuwentao
Copy link
Owner

update is called by core, so hass is there at the time of invocation. It cannot happen it's not

No, I can certainly confirm that:

if not self.hass:
            _LOGGER.error(
                "Midea entity update_state for %s [%s] with status %s",

it has been matched in my device error log,
but I'm not enable the debug log, only one line error log exist, so I can't find out the root cause when this error exist.

@chemelli74
Copy link
Collaborator Author

There must be a issue, probably a thread issue, as update cannot be called if hass is None.

I'll add a check, but with a note that we need to investigate.

Copy link
Collaborator

@rokam rokam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rokam rokam merged commit f47bbfd into wuwentao:master Sep 19, 2024
10 checks passed
@chemelli74 chemelli74 deleted the chemelli74-no-refresh branch September 20, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants