Added EAP-Controller (Omada)#15382
Closed
IVI053 wants to merge 5 commits intohome-assistant:masterfrom
Closed
Conversation
Added possibility to get data from EAP-Controller (new name 'Omada'). Tested with Controller V2.5.3 running on Linux.
Contributor
houndci-bot
reviewed
Jul 9, 2018
|
|
||
| return False | ||
|
|
||
| class TplinkEAPControllerDeviceScanner(TplinkDeviceScanner): |
There was a problem hiding this comment.
IndentationError: unindent does not match any outer indentation level
houndci-bot
reviewed
Jul 9, 2018
| device['mac'].replace('-', ':'): { | ||
| 'mac': device['mac'].replace('-', ':'), | ||
| 'name': device['name'], | ||
| 'ap': html.unescape(device['apName']), |
| except ValueError: | ||
| _LOGGER.error("AP didn't respond with JSON. " | ||
| "Check if credentials are correct") | ||
| return False |
|
|
||
| clients = session.post(client_list_url,data=post_data) | ||
|
|
||
| try: |
| client_list_url = '{}/monitor/allActiveClients'.format(base_url) | ||
| post_data = (('currentPage',1),('currentPageSize',1000)) | ||
|
|
||
| clients = session.post(client_list_url,data=post_data) |
| else: | ||
| _LOGGER.info("Loading wireless clients...") | ||
| client_list_url = '{}/monitor/allActiveClients'.format(base_url) | ||
| post_data = (('currentPage',1),('currentPageSize',1000)) |
| session.verify=False | ||
|
|
||
| login = session.post('{}/login'.format(base_url), data=(('name',self.username),('password',self.password))) | ||
| if(login.status_code != 200): |
| session = requests.session() | ||
| session.verify=False | ||
|
|
||
| login = session.post('{}/login'.format(base_url), data=(('name',self.username),('password',self.password))) |
There was a problem hiding this comment.
missing whitespace after ','
line too long (115 > 79 characters)
|
|
||
| # Create a session to handle cookie easier | ||
| session = requests.session() | ||
| session.verify=False |
|
|
||
| def get_extra_attributes(self, device): | ||
| return self.last_results.get(device) | ||
| def _update_info(self): |
|
|
||
| return False | ||
|
|
||
| class TplinkEAPControllerDeviceScanner(TplinkDeviceScanner): |
houndci-bot
reviewed
Jul 9, 2018
| else: | ||
| _LOGGER.info("Loading wireless clients...") | ||
| client_list_url = '{}/monitor/allActiveClients'.format(base_url) | ||
| post_data = (('currentPage',1), ('currentPageSize',1000)) |
| _LOGGER.error('Login failed, response was: '+json['message']) | ||
| else: | ||
| _LOGGER.info("Loading wireless clients...") | ||
| client_list_url = '{}/monitor/allActiveClients'.format(base_url) |
| data=(('name',self.username), | ||
| ('password',self.password))) | ||
| if(login.status_code != 200): | ||
| _LOGGER.error('HTTP Request failed! Status: '+str(login.status_code)) |
| session.verify = False | ||
|
|
||
| login = session.post('{}/login'.format(base_url), | ||
| data=(('name',self.username), |
|
|
||
| def get_extra_attributes(self, device): | ||
| return self.last_results.get(device) | ||
|
|
houndci-bot
reviewed
Jul 9, 2018
| else: | ||
| _LOGGER.info("Loading wireless clients...") | ||
| client_list_url = '{}/monitor/allActiveClients' | ||
| .format(base_url) |
There was a problem hiding this comment.
IndentationError: unexpected indent
indentation is not a multiple of four
unexpected indentation
| ('password', self.password))) | ||
| if(login.status_code != 200): | ||
| _LOGGER.error('HTTP Request failed with Status: ' | ||
| +str(login.status_code)) |
Member
|
Also, here apply the same as mentioned in this comment. |
Member
|
Going to close this. Please open a new PR when you based off the right branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Added possibility to get data from EAP-Controller (new name 'Omada').
Tested with Controller V2.5.3 running on Linux.
Example entry for
configuration.yaml(if applicable):unchanged
Checklist:
If the code communicates with devices, web services, or third-party tools:
no new requirements