Skip to content
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 config flow to transmission #26434

Merged
merged 13 commits into from Sep 26, 2019

Conversation

@engrbm87
Copy link
Contributor

commented Sep 4, 2019

Breaking Change:

The Transmission integration can now be configured through a config flow via Integrations in the GUI. Once configured all sensors and switches will be created and available for the user.
monitored_conditions has been removed so existing users need to update their configuration in configuration.yaml and remove monitored conditions. The existing configuration will be imported as an entry under Integrations.

Description:

In addition to the previous sensors and switches that were available under monitored_conditions a new switch to start and stop all torrents has been added.
The update Interval is now an option that can be altered under options.

Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#10293

Example entry for configuration.yaml (if applicable):

transmission:
  host: 192.168.1.1

Checklist:

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • I have followed the development checklist

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. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.
@project-bot project-bot bot added this to Needs review in Dev Sep 4, 2019
@engrbm87 engrbm87 referenced this pull request Sep 4, 2019
2 of 2 tasks complete
@engrbm87

This comment has been minimized.

Copy link
Contributor Author

commented Sep 5, 2019

Open Issue : 26334

homeassistant/components/transmission/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/transmission/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/transmission/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/transmission/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/transmission/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/transmission/const.py Outdated Show resolved Hide resolved
homeassistant/components/transmission/strings.json Outdated Show resolved Hide resolved
homeassistant/components/transmission/switch.py Outdated Show resolved Hide resolved
homeassistant/components/transmission/config_flow.py Outdated Show resolved Hide resolved
Dev automation moved this from Needs review to Review in progress Sep 5, 2019
Copy link
Member

left a comment

Since the library doesn't support asyncio, we have to think about sync vs async context all the time in this integration. Please take care, especially when calling api functions.

I think we have a good separation now, considering this complication. All the methods on the TransmissionClient class are async. All the methods on the TransmissionData class are sync.

homeassistant/components/transmission/__init__.py Outdated Show resolved Hide resolved
@MartinHjelmare

This comment has been minimized.

Copy link
Member

commented Sep 9, 2019

Please run python3 -m script.hassfest.

@engrbm87

This comment has been minimized.

Copy link
Contributor Author

commented Sep 9, 2019

Please run python3 -m script.hassfest.

There is an issue with this script and the black pre-commit (issue#26334). transmission is already in the list in this file

Dev automation moved this from Review in progress to Reviewer approved Sep 9, 2019
Copy link
Member

left a comment

Good!

Dev automation moved this from Reviewer approved to Review in progress Sep 9, 2019
Copy link
Member

left a comment

Sorry, we require tests of the config flow too. It should be included in coverage calculation.

@MartinHjelmare

This comment has been minimized.

Copy link
Member

commented Sep 17, 2019

File config_flows.py is not up to date. Please run python3 -m script.hassfest.

@engrbm87

This comment has been minimized.

Copy link
Contributor Author

commented Sep 17, 2019

File config_flows.py is not up to date. Please run python3 -m script.hassfest.

I am not able to commit after running the script. Black is adding a comma to the last line.

@MartinHjelmare

This comment has been minimized.

Copy link
Member

commented Sep 17, 2019

Try rebasing on latest dev branch if that problem persists. We should have fixed it in the dev branch by turning off formattting of the generated files.

@MartinHjelmare MartinHjelmare moved this from Needs review to Review in progress in Dev Sep 17, 2019
@MartinHjelmare

This comment has been minimized.

Copy link
Member

commented Sep 18, 2019

Looks good! Please update .coveragerc and don't exclude the config flow module from coverage calculation.

@frenck

This comment has been minimized.

Copy link
Member

commented Sep 20, 2019

Thank you for your contribution thus far! 🎖 Since this is a significant contribution, we would appreciate you'd added yourself to the list of code owners for this integration. ❤️

Please, add your GitHub username to the manifest.json of this integration.

For more information about "code owners", see: Architecture Decision Record 0008: Code owners.

@engrbm87

This comment has been minimized.

Copy link
Contributor Author

commented Sep 21, 2019

Thank you for your contribution thus far! 🎖 Since this is a significant contribution, we would appreciate you'd added yourself to the list of code owners for this integration. ❤️

Please, add your GitHub username to the manifest.json of this integration.

For more information about "code owners", see: Architecture Decision Record 0008: Code owners.

Thanks for the opportunity to contribute in HA which I really like. I have added my username as code owner.

@MartinHjelmare

This comment has been minimized.

Copy link
Member

commented Sep 21, 2019

Please add tests of the options flow too, to reach 100% test coverage of the config flow module.

Copy link
Member

left a comment

Looks great!

Dev automation moved this from Review in progress to Reviewer approved Sep 24, 2019
@MartinHjelmare

This comment has been minimized.

Copy link
Member

commented Sep 24, 2019

Please add a breaking change paragraph in the PR description and update the description with the current changes in the PR. The breaking change paragraph should describe briefly what changed and what the user needs to do to cope with the breaking change.

@MartinHjelmare MartinHjelmare merged commit 82b77c2 into home-assistant:dev Sep 26, 2019
9 checks passed
9 checks passed
CI Build #20190923.40 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
Dev automation moved this from Reviewer approved to Done Sep 26, 2019
KJonline added a commit to KJonline/home-assistant that referenced this pull request Sep 26, 2019
* dev: (87 commits)
  Add ecobee services to create and delete vacations (home-assistant#26923)
  Centralize rainbird config and add binary sensor platform (home-assistant#26393)
  Add config flow to transmission (home-assistant#26434)
  Add Plex config options support (home-assistant#26870)
  Bump pyobihai, add unique ID and availability (home-assistant#26922)
  Add mysensors codeowner (home-assistant#26917)
  [ci skip] Translation update
  Add MySensors ACK (home-assistant#26894)
  Remove lamps and groups from ha when removed from Hue (home-assistant#26881)
  Add config flow to ecobee (home-assistant#26634)
  deCONZ - Increase bridge discovery robustness in config flow (home-assistant#26911)
  Add call direction sensor for Obihai (home-assistant#26867)
  Bumped version to 0.99.3
  HM-CC-TC was not recognized (home-assistant#26623)
  Add google_assistant alarm_control_panel (home-assistant#26249)
  deCONZ - Improve ssdp discovery by storing uuid in config entry (home-assistant#26882)
  Fix missing whitespace around arithmetic operator (home-assistant#26908)
  Fix bed_activity history chart of the Xiaomi Aqara vibration sensor (home-assistant#26875)
  Add voltage attribute to Xiaomi Aqara devices (home-assistant#26876)
  Bump ndms2-client to 0.0.9 (home-assistant#26899)
  ...
@lock lock bot locked and limited conversation to collaborators Sep 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
4 participants
You can’t perform that action at this time.