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 flume support #27235
Add flume support #27235
Conversation
Add support for Flume API and sensor
Timezone is now a required option in configuration.yaml
Add flume to be ommited from testing. Add @ChrisMandich as Flume Code owner
This reverts commit 0b27437.
Added Documentation URL for Flume to HASS.IO
Added missing Newline at EOF.
Update sensor to not required Device ID for configuration. Now loops through all available Type 2 devices and adds them as an entity.
Resolved errors related to code owners and requirements. Using hassfest and gen_requirements_all
Implemented recommendations from @Quentame. Including time zone from Home Assistant, Updated variable names, and Consolidated duplicate functions.
This includes: components name, using f-strings instead of concat, snake_case for variables, constants for the addition of future device types, clearer errors, and removed variables no longer in use.
Restored unit_of_measurement. Updated return to "gal".
Include protected attributes in setup_platform.
homeassistant/components/flume/sensor.py:63:11: W0703: Catching too general exception Exception (broad-except) homeassistant/components/flume/sensor.py:133:8: R1720: Unnecessary "else" after "raise" (no-else-raise) homeassistant/components/flume/sensor.py:162:8: R1705: Unnecessary "else" after "return" (no-else-return) homeassistant/components/flume/sensor.py:236:8: R1720: Unnecessary "else" after "raise" (no-else-raise)
I'm okay with the broad exception clause. homeassistant/components/flume/sensor.py:65:11: W0703: Catching too general exception Exception (broad-except)
Add more specific exceptions for Try/Except.
@Quentame I'm fairly new to contributing to Github projects. I believe I corrected all they Pylint errors. Can you guide me on what 'codecov/patch' is and what is required to get complete this successfully? |
All communication to external devices or services must be wrapped in an external Python library hosted on pypi. See the: https://developers.home-assistant.io/docs/en/development_checklist.html Furthermore, the config flow requires tests, please add those to make Lastly, please open up a PR in our documentation repository for this new integration. Please be sure to link the PR in the openings post of this PR. Thanks! 👍 |
Hi again @ChrisMandich ! Me too, I'm quite new in contributions and also in Python dev actually. But most of the comments I've added to your PR are ones I already got while adding config flow to Linky and iCloud components. I've haven't built a component from the ground up but your PR pushed me to review, hoping someone else will join the game 😉 (I'm not in HA team but new integration with passed pipeline attracts). I think you should add your untested files to the I know that config flow needs tests but this PR doesn't have it (you should consider adding it perhaps). @frenck : Where are the test/cov requirements written in the documentation ? In the component checklit there is nothing about the coverage and tests are just strongly recommended. |
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 should rework how APIs are called. Look at the codebase and search for @Throttle
.
Added @MartinHjelmare recommended changes.
Resolving PyLint error
Thank for bringing this forward. I've been casually working on a similar project, and I have a couple suggestions:
There's also a thread that a few Flume users are following that might be useful. Let me know if you have any questions about my code, or if there's anything I can do to help. |
Remove `KeyError`. Add length check for flume entity list before adding.
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.
Looks good!
So it can be merged ? |
Description:
Add's sensor for Flume water sensor found here: https://flumetech.com/
Related issue (if applicable): fixes #
Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#10624
Example entry for
configuration.yaml
(if applicable):Checklist:
tox
. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
Found here: Added documentation for Flume integration home-assistant.io#10624
If the code communicates with devices, web services, or third-party tools:
python3 -m script.hassfest
.requirements_all.txt
by runningpython3 -m script.gen_requirements_all
..coveragerc
.If the code does not interact with devices: