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
Add Valve integration #102184
Add Valve integration #102184
Conversation
This is a WIP but I wanted put it in the wild now. There are a couple outstanding errors I'm not sure how to solve and prevents me from even making this commit without * [ERROR] [MANIFEST] Domain is missing an IoT ClassWhat iot_class should an integration that is more like an abstract contract for other integrations to build on top of have? * [ERROR] [SERVICES] Invalid services.yaml: Unknown supported feature 'valve.ValveEntityFeature.CLOSE' @ data['close_valve']['target']['entity'][0]['supported_features'][0]. Got NoneI have a couple errors similar to these but I can't figure out why I get them, I see no difference with how other services manifest and integration handle supported features. |
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Add the integration domain name to the |
Update the selectors helper: core/homeassistant/helpers/selector.py Lines 83 to 125 in 3cedfbc
|
@MartinHjelmare thanks, I can commit normally now! I'll try to have this ready tonight, pending documentation. |
This adds the valve integration discussed in home-assistant/architecture#975 Most of the code is taken from the cover integration but simplified since valves can't tilt. There are a couple outstanding errors I'm not sure how to solve and prevents me from even making this commit without `--no-verify`.
9916c29
to
c89804a
Compare
@cibernox let me know if I can help |
@jbouwh I just pushed some changes with the feedback (mostly removing stuff so the functionality is minimal. Those can be added at a later date). If CI thinks this is good, I'll start writing docs. I may mention you to review and proof-read them, english is not my first language after all. |
English isn't my first language either. As log as homeassistant/components/poolstation/sensor.py is not removed, CI tests will keep failing. |
CI seems happy, now the docs. |
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.
Very nice, thanks @cibernox 👍
@emontnemery thank you for the last push! |
We have the frontend part in progress. When the frontend PR is approved and linked in this PR description, we can merge here. |
Front-end PR : home-assistant/frontend#19024 |
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.
We're changing our base entity descriptions to be keyword only and frozen. Since there are no existing platforms for the valve integration we can set it here without backwards compatibility layer.
Front-end is merged |
Thanks, @piitaya 👍 |
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
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.
LGTM,
Thnx @cibernox, @emontnemery, @MartinHjelmare
🎉 🎉 🎉 |
* Add Valve integration. This adds the valve integration discussed in home-assistant/architecture#975 Most of the code is taken from the cover integration but simplified since valves can't tilt. There are a couple outstanding errors I'm not sure how to solve and prevents me from even making this commit without `--no-verify`. * Apply PR feedback * Apply more feedback: Intruduce the bare minimum * Remove file commited by mistake * Hopefully this fixes tests * Match cover's typing and mypy settings * Change some configuration files * Fix test * Increase code coverage a little * Code coverate inproved to 91% * 95% code coverage * Coverate up to 97% * Coverage 98% * Apply PR feedback * Even more feedback * Add line I shouldn't have removed * Derive closed/open state from current position * Hopefully last feedback * Update homeassistant/components/valve/__init__.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/valve/__init__.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Remove unnecesary translation * Remove unused method arguments * Complete code coverage * Update homeassistant/components/valve/__init__.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Simplify tests * Update homeassistant/components/valve/__init__.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Apply last feedback * Update tests/components/valve/test_init.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Update tests/components/valve/test_init.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Update tests/testing_config/custom_components/test/valve.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * More feedback * Apply suggestion * And more feedback * Apply feedback * Remove commented code * Reverse logic to unindent * Update homeassistant/components/valve/__init__.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/valve/__init__.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Implement stop valve for Mock valve * Fix tests now that I've implemented stop_valve * Assert it's neither opening nor closing * Use current position instead * Avoid scheduling executor when opening or closing * Fix incorrect bitwise operation * Simplify toggle * Remove uneeded partial functions * Make is_last_toggle_direction_open private * Remove valve from test custom integration * Improve test coverage * Address review comments * Address review comments * Address review comments * Update homeassistant/components/valve/__init__.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Update tests --------- Co-authored-by: Martin Hjelmare <marhje52@gmail.com> Co-authored-by: Erik <erik@montnemery.com>
Proposed change
This adds the valve integration discussed in home-assistant/architecture#975
Type of change
Additional information
Most of the code is taken from the cover integration but simplified since valves can't tilt.
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
.To help with the load of incoming pull requests: