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

Consolidate the netgear_lte configuration #22105

Merged

Conversation

Projects
None yet
4 participants
@amelchio
Copy link
Contributor

amelchio commented Mar 16, 2019

Breaking Change:

The netgear_lte configuration has been consolidated under netgear_lte:, check the documentation for more information.

Description:

Notes:

  • Omitting sensors will set up an unspecified set of default sensors.
  • Omitting notify will set up a notify service notify.netgear_lte with no default recipient.
  • Default notify target has been renamed recipient (fixes #20670).
  • Sensors no longer support scan_interval.
  • Hostnames no longer have to be repeated, even with multiple modems.

This should hopefully support the next PRs that I am planning:

  1. Add more sensors (not all added by default)
  2. Update sensor state with the dispatcher helper
  3. Maybe add a config entry

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

Example entry for configuration.yaml:

(The following snippets are both needleesly verbose in order to cover more situations)

Before:

netgear_lte:
  - host: !secret router_hostname
    password: !secret router_password
  - host: !secret failover_modem_hostname
    password: !secret failover_modem_password

notify:
  - platform: netgear_lte
    name: sms
    host: !secret router_hostname
    target: !secret admin_phone
  - platform: netgear_lte
    name: failover_sms
    host: !secret failover_modem_hostname
    target: !secret admin_phone

sensor:
  - platform: netgear_lte
    host: !secret router_hostname
    sensors:
      - usage
      - sms
  - platform: netgear_lte
    host: !secret failover_modem_hostname
    sensors:
      - usage
    scan_interval: 1800

Now:

netgear_lte:
  - host: !secret router_hostname
    password: !secret router_password
    notify:
      - name: sms
        recipient: !secret admin_phone
    sensor:
      monitored_conditions:
        - usage
        - sms
  - host: !secret failover_modem_hostname
    password: !secret failover_modem_password
    notify:
      - name: failover_sms
        recipient: !secret admin_phone
    sensor:
      monitored_conditions:
        - usage

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox.
  • 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][ex-requir]).
  • New dependencies are only imported inside functions that use them ([example][ex-import]).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.
@amelchio

This comment has been minimized.

Copy link
Contributor Author

amelchio commented Mar 21, 2019

Documentation updated.

@MartinHjelmare
Copy link
Member

MartinHjelmare left a comment

Just some small comments.

Show resolved Hide resolved homeassistant/components/netgear_lte/__init__.py Outdated
Show resolved Hide resolved homeassistant/components/netgear_lte/__init__.py Outdated
Show resolved Hide resolved homeassistant/components/netgear_lte/__init__.py
Show resolved Hide resolved homeassistant/components/netgear_lte/notify.py Outdated
Show resolved Hide resolved homeassistant/components/netgear_lte/sensor.py Outdated

amelchio added some commits Mar 21, 2019

@MartinHjelmare
Copy link
Member

MartinHjelmare left a comment

Nice!

@amelchio

This comment has been minimized.

Copy link
Contributor Author

amelchio commented Mar 22, 2019

Thanks for being so careful, it really improved things 🥳

@MartinHjelmare MartinHjelmare merged commit 2b6e197 into home-assistant:dev Mar 22, 2019

4 checks passed

Hound No violations found. Woof!
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.9%) to 93.674%
Details

@wafflebot wafflebot bot removed the in progress label Mar 22, 2019

@balloob balloob referenced this pull request Apr 3, 2019

Merged

0.91.0 #22688

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.