-
-
Notifications
You must be signed in to change notification settings - Fork 35.8k
Remove redudant state write in Smart Meter Texas #154126
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
Conversation
|
Hey there @grahamwetzler, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
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.
Mind if I push back a bit?
- Does the API still take 30 seconds to respond?
- Should we remove the separate listener and use
_handle_coordinator_updateinstead?
|
Thank you for taking a look!
|
|
That would be fixed now. The thing is that there is an inheritance issue here and we'd like a bit of help to fix this :) # pylint: disable-next=hass-invalid-inheritance # needs fixing
class SmartMeterTexasSensor(CoordinatorEntity, RestoreEntity, SensorEntity):So if you'd be able to help us, we'd be very grateful :) |
|
And the reason it is a RestoreEntity (which means it will restore a snapshot of a previous state) is because the startup might take too long and that the first update might come later. Hence I am wondering if it still takes 30s, otherwise we can remove that logic and make it "normal" |
Proposed change
Remove redundant call to update state. async_write_ha_state() is already called in BaseCoordinatorEntity.
This extra call results in a duplicate EVENT_STATE_REPORTED.
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.To help with the load of incoming pull requests: