Skip to content

Conversation

@janiversen
Copy link
Member

@janiversen janiversen commented Apr 9, 2020

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

  • Dependency upgrade
  • [ x] Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml

Additional information

Checklist

  • [ x] The code change is tested and works locally.
  • [x ] Local tests pass. Your PR cannot be merged unless tests pass
  • [ x] There is no commented out code in this PR.
  • [x ] I have followed the development checklist
  • [x ] The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

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.
@probot-home-assistant
Copy link

Hey there @adamchengtkc, mind taking a look at this pull request as its been labeled with a integration (modbus) you are listed as a codeowner for? Thanks!

@MartinHjelmare MartinHjelmare changed the title solve modbus issue #33872 Fix modbus default delay Apr 9, 2020
Do not wait for start event, but activate pymodbus directly in
async setup.
Remark, this does not work, async_setup hangs.

clean start_modbus() from async calls, leaving only the pymodbus
setup.
Moved listen_once back to start_modbus, since it is sync.
Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Great!

@MartinHjelmare
Copy link
Member

Should we close #33873 with this PR?

@MartinHjelmare MartinHjelmare added this to the 0.108.2 milestone Apr 9, 2020
@janiversen
Copy link
Member Author

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.

@MartinHjelmare
Copy link
Member

Ok.

@MartinHjelmare MartinHjelmare merged commit dd7fbef into home-assistant:dev Apr 9, 2020
@janiversen janiversen deleted the modbus_issue3 branch April 9, 2020 13:28
balloob pushed a commit that referenced this pull request Apr 10, 2020
* 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.
@balloob balloob mentioned this pull request Apr 10, 2020
@lock lock bot locked and limited conversation to collaborators Apr 15, 2020
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.

4 participants