Skip to content

Split out iperf3 into a component with a sensor platform#21138

Merged
andrewsayre merged 7 commits into
home-assistant:devfrom
rohankapoorcom:iperf3-sensor-component
Feb 23, 2019
Merged

Split out iperf3 into a component with a sensor platform#21138
andrewsayre merged 7 commits into
home-assistant:devfrom
rohankapoorcom:iperf3-sensor-component

Conversation

@rohankapoorcom
Copy link
Copy Markdown
Member

@rohankapoorcom rohankapoorcom commented Feb 17, 2019

Description:

Per home-assistant/architecture#131, sensor platforms should not be registering services. iperf3 is one of several that does and this should be cleaned up. This sensor has a service call which is used to manually run a speedtest and then updates the sensor with that information.

I moved all of the setup/service logic to a new iperf3 component and then used that component
inside the sensor platform. All configuration has been moved to the component and the sensor platform is loaded automatically when the component is loaded.

Using a dispatcher signal, the component notifies the platform when it's finished a speedtest so the platform can update it's data.

Same as #20341, #20527 but for iperf3.

Breaking Change: The iperf3 sensor platform has been separated into a component and a sensor to remove the service from the sensor platform. Configuration options have changed, please review the documentation and select the correct options.

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

Example entry for configuration.yaml (if applicable):

iperf3:
  hosts:
    - host: iperf.he.net

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@rohankapoorcom rohankapoorcom changed the title Iperf3 sensor component Split out Iperf3 into a component with a sensor platform Feb 17, 2019
@rohankapoorcom rohankapoorcom changed the title Split out Iperf3 into a component with a sensor platform Split out iperf3 into a component with a sensor platform Feb 17, 2019
Comment thread homeassistant/components/iperf3/__init__.py
Comment thread homeassistant/components/iperf3/sensor.py Outdated
Comment thread homeassistant/components/iperf3/__init__.py Outdated
Comment thread homeassistant/components/iperf3/sensor.py Outdated
Comment thread homeassistant/components/iperf3/sensor.py Outdated
Comment thread homeassistant/components/iperf3/sensor.py Outdated
@MartinHjelmare
Copy link
Copy Markdown
Member

Can be merged when build passes.

@andrewsayre andrewsayre merged commit dc5b8fd into home-assistant:dev Feb 23, 2019
@ghost ghost removed the in progress label Feb 23, 2019
@rohankapoorcom rohankapoorcom deleted the iperf3-sensor-component branch February 26, 2019 07:19
@balloob balloob mentioned this pull request Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants