Skip to content

Conversation

@crug80
Copy link
Contributor

@crug80 crug80 commented Feb 21, 2025

Breaking change

Proposed change

Pymodbus requires for write_registers function a list of integer and a list of bool for write_coils

Actually this requirements is satisfied only in the Climate component, where specific config parameters help the modbus climate to pass correctly the values to underlying pymodbus library.
Switches, lights or fans, instead, use a different approach. I suppose that in the older version of the library this lack was fixed by the library itself, now instead this has generated the impossibility to use the modbus component in those users who need to use coils/holdings registers for switches/fans/lights as tracked in several issues.

This PR before to call write_registers or write_coils, check if the value is correctly a list and it forces to a list in case it is not.

Type of change

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

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format 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.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@bdraco bdraco merged commit baa3b15 into home-assistant:dev Feb 22, 2025
46 checks passed
@bdraco
Copy link
Member

bdraco commented Feb 22, 2025

Thanks @crug80

@crug80 crug80 deleted the fixWriteRegistersIssue branch February 22, 2025 16:54
@github-actions github-actions bot locked and limited conversation to collaborators Feb 23, 2025
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.

Modbus issue - Working YAML stopped working since 25.2.0

2 participants