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 Synology SRM device tracker #20320

Merged
merged 1 commit into from Jan 29, 2019

Conversation

Projects
None yet
8 participants
@aerialls
Copy link
Contributor

aerialls commented Jan 22, 2019

Description

This PR adds the device tracker for Synology SRM routers.

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

Example entry for configuration.yaml (if applicable):

device_tracker:
  - platform: synology_srm
    host: 10.10.10.254
    password: !secret synology_srm_password
    new_device_defaults:
      track_new_devices: false
      hide_if_away: true

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.
@homeassistant

This comment has been minimized.

Copy link

homeassistant commented Jan 22, 2019

Hi @aerialls,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@wafflebot wafflebot bot added the in progress label Jan 22, 2019

@homeassistant homeassistant added cla-signed and removed cla-needed labels Jan 22, 2019

@frenck frenck added the docs-missing label Jan 22, 2019

@aerialls aerialls force-pushed the aerialls:synology-srm branch from 7df0662 to 81811b1 Jan 22, 2019

@aerialls aerialls referenced this pull request Jan 22, 2019

Merged

Add documentation for Synology SRM device tracker #8240

2 of 2 tasks complete
@aerialls

This comment has been minimized.

Copy link
Contributor Author

aerialls commented Jan 22, 2019

I've added the documentation.

@aerialls aerialls force-pushed the aerialls:synology-srm branch from 81811b1 to 317a799 Jan 22, 2019

@aerialls aerialls closed this Jan 22, 2019

@aerialls aerialls reopened this Jan 22, 2019

@wafflebot wafflebot bot added in progress and removed in progress labels Jan 22, 2019

@frenck frenck removed the docs-missing label Jan 22, 2019

@aerialls

This comment has been minimized.

Copy link
Contributor Author

aerialls commented Jan 23, 2019

All good for me. Waiting for a review! 🚀

@pvizeli pvizeli merged commit 6859d52 into home-assistant:dev Jan 29, 2019

5 checks passed

Hound No violations found. Woof!
WIP Legacy commit status override — see details
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 93.11%
Details

@wafflebot wafflebot bot removed the in progress label Jan 29, 2019

@pvizeli

This comment has been minimized.

Copy link
Member

pvizeli commented Jan 29, 2019

Thanks

@MaxG88

This comment has been minimized.

Copy link
Contributor

MaxG88 commented Jan 29, 2019

Hi,

Thank you for making this component!

When I saw this component, I added it to my installation as a custom component and have been encountering the following exception about once every 4-5 Home Assistant restarts:
synology_srm.http.SynologyException: Unknown error, please check the Synology API documentation (error=119)
Here's the stacktrace:

Error setting up platform synology_srm
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/__init__.py", line 176, in async_setup_platform
    platform.get_scanner, hass, {DOMAIN: p_config})
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/device_tracker/synology_srm.py", line 37, in get_scanner
    scanner = SynologySrmDeviceScanner(config[DOMAIN])
  File "/home/homeassistant/.homeassistant/custom_components/device_tracker/synology_srm.py", line 61, in __init__
    self.success_init = self._update_info()
  File "/home/homeassistant/.homeassistant/custom_components/device_tracker/synology_srm.py", line 85, in _update_info
    devices = self.client.mesh.network_wifidevice()
  File "/srv/homeassistant/lib/python3.5/site-packages/synology_srm/api/mesh.py", line 18, in network_wifidevice
    version=1
  File "/srv/homeassistant/lib/python3.5/site-packages/synology_srm/http.py", line 136, in call
    "Unknown error, please check the Synology API documentation"

If you think that's an error that, for some reason, I would be the only one to get, then feel free to ignore this since it's not a huge deal for me. However, if you have some time and think the issue could affect more people, I think it might be worth to have a look. If you need help reproducing this issue (personally I just have to restart Home Assistant a couple times and I get it), I could help you.

In case this is of any use, my Home Assistant is running in venv on Ubuntu 14.04.

@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Jan 29, 2019

Please open an issue if you suspect a bug.

Merged PRs should not be used for enhancement discussion or bug reports. If you've found a bug it's ok to make a review with inline comments and link to an issue that reports the bug.

Thanks!

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Jan 29, 2019

@aerialls aerialls deleted the aerialls:synology-srm branch Feb 19, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.