Add Modbus fan integration#48558
Add Modbus fan integration#48558janiversen merged 3 commits intohome-assistant:devfrom Lutemi:feature/modbus-fan
Conversation
|
Hey there @adamchengtkc, @janiversen, mind taking a look at this pull request as its been labeled with an integration ( |
janiversen
left a comment
There was a problem hiding this comment.
I approve, but I hope you will still do something about the few comments I have.
|
Update:
@janiversen, @yury-sannikov please take another look when you'll have some time. Thanks! |
janiversen
left a comment
There was a problem hiding this comment.
All good, one small adjustment it is all green.
|
And look how fast you got a review :-) just thinking a bit about #48544 |
|
@janiversen I got you one comment, which is still pending. Comment on that and I'll approve the change. |
janiversen
left a comment
There was a problem hiding this comment.
I like this one, that is a much needed feature.
There was a problem hiding this comment.
Looks good to me.
I would add some tests that the fan is actually turning on/off, like here, however, it's up to you, since this PR just uses Coil and Register switch
|
I think that covering the |
|
I agree with @vzahradnik. Our test cases should in principle only test untested code, we do not want to duplicate test cases just to show fan have the same tests as switch.
?? I think I missed something here, there are no comments on #48544 |
|
Code updated to reflect latest |
|
|
|
@vzahradnik when you update, you will see that class modbusHub have changed, you now need to call async_pymodbus_call(.... CALL_TYPE*) see e.g. cover.py |
Proposed change
This PR adds the Modbus Fan entity, which is based on Modbus Switch. At the moment, it supports only the turn_on() and turn_off() methods, but it can be extended.
We've discussed this feature in PR #33551. Feel free to take a look for reference.
Type of change
Example entry for
configuration.yaml:Additional information
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:
To help with the load of incoming pull requests: