-
-
Notifications
You must be signed in to change notification settings - Fork 36.4k
Fix modbus default delay #33877
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 modbus default delay #33877
Conversation
CONF_DELAY was used in a serial connection, which is not permitted. Sometimes async_update is called after async_setup is completed, but before event EVENT_HOMEASSISTANT_START is issued, leading to a missing object.
|
Hey there @adamchengtkc, mind taking a look at this pull request as its been labeled with a integration ( |
Do not wait for start event, but activate pymodbus directly in async setup.
MartinHjelmare
left a comment
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.
Great!
|
Should we close #33873 with this PR? |
|
I would prefer to keep the issue open until I have a confirmation from the people that it works, if that is not a problem for you. |
|
Ok. |
* solve modbus issue #33872 CONF_DELAY was used in a serial connection, which is not permitted. Sometimes async_update is called after async_setup is completed, but before event EVENT_HOMEASSISTANT_START is issued, leading to a missing object. * resolve review comment. Do not wait for start event, but activate pymodbus directly in async setup. * review 2 Remark, this does not work, async_setup hangs. clean start_modbus() from async calls, leaving only the pymodbus setup. * review 2a Moved listen_once back to start_modbus, since it is sync.
Breaking change
Proposed change
CONF_DELAY was used in a serial connection, which is not
permitted.
Sometimes async_update is called after async_setup is completed,
but before event EVENT_HOMEASSISTANT_START is issued, leading to
a missing object. So added a test for missing object.
Type of change
Example entry for
configuration.yaml:# Example configuration.yamlAdditional information
Modbus crashed on 0.108.1 with pakcages #33873
Update modbus text, with warning (relevant for V1.08) home-assistant.io#12762
Checklist
black --fast 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..coveragerc.The integration reached or maintains the following Integration Quality Scale: