Skip to content

Log out of TP-Link router after devices are recorded.#7289

Merged
robbiet480 merged 8 commits into
home-assistant:devfrom
jminardi:jminardi/tplink-logout
May 5, 2017
Merged

Log out of TP-Link router after devices are recorded.#7289
robbiet480 merged 8 commits into
home-assistant:devfrom
jminardi:jminardi/tplink-logout

Conversation

@jminardi
Copy link
Copy Markdown
Contributor

@jminardi jminardi commented Apr 25, 2017

Description:

While investigating #7262 I discovered my issue was that I needed to use the "encrypted password" as described in the TP-Link docs (Even though I don't have the model listed there). Having the error message here would have helped me see that sooner.

I also updated the Tplink3DeviceScanner class to log out of the admin interface after it gets the info it needs. The allows someone else to log into the interface without waiting minutes for the timeout.

Related issue (if applicable): fixes #7262

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>

Example entry for configuration.yaml (if applicable):

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.

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

@mention-bot
Copy link
Copy Markdown

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

@homeassistant
Copy link
Copy Markdown
Contributor

Hi @jminardi,

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!

'form=logout').format(self.host, self.stok)
referer = 'http://{}/webpages/index.html'.format(self.host)

response = requests.post(url,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

local variable 'response' is assigned to but never used

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@pvizeli
Copy link
Copy Markdown
Member

pvizeli commented Apr 28, 2017

Looks not bad. Please address comments from travis

jminardi added a commit to jminardi/home-assistant.github.io that referenced this pull request May 1, 2017
jminardi added a commit to jminardi/home-assistant.github.io that referenced this pull request May 1, 2017
jminardi added a commit to jminardi/home-assistant.github.io that referenced this pull request May 1, 2017
@michaelarnauts
Copy link
Copy Markdown
Contributor

Use a comma instead of a percent sign. Don't put the message in a string.

fabaff pushed a commit to home-assistant/home-assistant.io that referenced this pull request May 1, 2017
* Update device_tracker.tplink.markdown

Depends on home-assistant/core#7289

* Make a real sentence
@jminardi
Copy link
Copy Markdown
Contributor Author

jminardi commented May 1, 2017

Ok, finally got the tests to pass, I think this is good to go now.

@robbiet480 robbiet480 merged commit 12910de into home-assistant:dev May 5, 2017
@jminardi jminardi deleted the jminardi/tplink-logout branch May 8, 2017 02:24
@home-assistant home-assistant locked and limited conversation to collaborators Aug 12, 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.

KeyError: 'set-cookie' when trying to use tplink as device tracker

8 participants