Skip to content

Add device tracker for Linksys Smart Wifi devices#8144

Merged
balloob merged 2 commits into
home-assistant:devfrom
mortenlj:dev
Jun 24, 2017
Merged

Add device tracker for Linksys Smart Wifi devices#8144
balloob merged 2 commits into
home-assistant:devfrom
mortenlj:dev

Conversation

@mortenlj
Copy link
Copy Markdown
Contributor

@mortenlj mortenlj commented Jun 21, 2017

Description:

Support for Linksys Smart Wifi devices, which looks like it's going to be all new devices from now on.

I have not had time to add documentation, but I can try to find time to look at that later this week.

Related issue (if applicable): #7487

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

Example entry for configuration.yaml (if applicable):

device_tracker:
  - platform: linksys_smart
    host: 192.168.1.1
    interval_seconds: 60

Checklist:

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

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

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

@homeassistant
Copy link
Copy Markdown
Contributor

Hi @mortenlj,

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!

@mention-bot
Copy link
Copy Markdown

@mortenlj, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob, @fabaff and @happyleavesaoc to be potential reviewers.

}]
return requests.post('http://{}/JNAP/'.format(self.host),
timeout=DEFAULT_TIMEOUT,
headers={"X-JNAP-Action": "http://linksys.com/jnap/core/Transaction"},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (99 > 79 characters)

for device in devices:
macs = device["knownMACAddresses"]
if not macs:
_LOGGER.warn("Found device without known MAC address, skipping")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (88 > 79 characters)

self.last_results = {}
response = self._make_request()
if response.status_code != 200:
_LOGGER.error("Unable to get device list from router, got HTTP status code %d", response.status_code)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (117 > 79 characters)

raise ConnectionError("Cannot connect to Linksys Access Point")

def scan_devices(self):
"""Scan for new devices and return a list with found device IDs (MACs)."""
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (82 > 79 characters)

Copy link
Copy Markdown
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks! 🐬

@balloob balloob merged commit 0099168 into home-assistant:dev Jun 24, 2017
@balloob balloob mentioned this pull request Jul 1, 2017
dethpickle pushed a commit to dethpickle/home-assistant that referenced this pull request Aug 18, 2017
* Add device tracker for Linksys Smart Wifi devices

* Fixing code style
@home-assistant home-assistant locked and limited conversation to collaborators Oct 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants