Skip to content

Added EAP-Controller (Omada)#15382

Closed
IVI053 wants to merge 5 commits intohome-assistant:masterfrom
IVI053:patch-1
Closed

Added EAP-Controller (Omada)#15382
IVI053 wants to merge 5 commits intohome-assistant:masterfrom
IVI053:patch-1

Conversation

@IVI053
Copy link
Copy Markdown

@IVI053 IVI053 commented Jul 9, 2018

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:

  • The code change is tested and works locally.

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

Added possibility to get data from EAP-Controller (new name 'Omada').
Tested with Controller V2.5.3 running on Linux.
@homeassistant homeassistant added integration: device_tracker core merging-to-master This PR is merging into the master branch and should probably change the branch to `dev`. labels Jul 9, 2018
@homeassistant
Copy link
Copy Markdown
Contributor

Hi @IVI053,

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!

@ghost ghost added the in progress label Jul 9, 2018

return False

class TplinkEAPControllerDeviceScanner(TplinkDeviceScanner):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

IndentationError: unindent does not match any outer indentation level

device['mac'].replace('-', ':'): {
'mac': device['mac'].replace('-', ':'),
'name': device['name'],
'ap': html.unescape(device['apName']),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

undefined name 'html'

except ValueError:
_LOGGER.error("AP didn't respond with JSON. "
"Check if credentials are correct")
return False
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

trailing whitespace


clients = session.post(client_list_url,data=post_data)

try:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

trailing whitespace

client_list_url = '{}/monitor/allActiveClients'.format(base_url)
post_data = (('currentPage',1),('currentPageSize',1000))

clients = session.post(client_list_url,data=post_data)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

missing whitespace after ','

else:
_LOGGER.info("Loading wireless clients...")
client_list_url = '{}/monitor/allActiveClients'.format(base_url)
post_data = (('currentPage',1),('currentPageSize',1000))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

missing whitespace after ','

session.verify=False

login = session.post('{}/login'.format(base_url), data=(('name',self.username),('password',self.password)))
if(login.status_code != 200):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

trailing whitespace

session = requests.session()
session.verify=False

login = session.post('{}/login'.format(base_url), data=(('name',self.username),('password',self.password)))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

missing whitespace after ','
line too long (115 > 79 characters)


# Create a session to handle cookie easier
session = requests.session()
session.verify=False
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

missing whitespace around operator


def get_extra_attributes(self, device):
return self.last_results.get(device)
def _update_info(self):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

expected 1 blank line, found 0


return False

class TplinkEAPControllerDeviceScanner(TplinkDeviceScanner):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

expected 2 blank lines, found 1

else:
_LOGGER.info("Loading wireless clients...")
client_list_url = '{}/monitor/allActiveClients'.format(base_url)
post_data = (('currentPage',1), ('currentPageSize',1000))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

missing whitespace after ','

_LOGGER.error('Login failed, response was: '+json['message'])
else:
_LOGGER.info("Loading wireless clients...")
client_list_url = '{}/monitor/allActiveClients'.format(base_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.

line too long (80 > 79 characters)

data=(('name',self.username),
('password',self.password)))
if(login.status_code != 200):
_LOGGER.error('HTTP Request failed! Status: '+str(login.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 (81 > 79 characters)

session.verify = False

login = session.post('{}/login'.format(base_url),
data=(('name',self.username),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

missing whitespace after ','


def get_extra_attributes(self, device):
return self.last_results.get(device)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

blank line contains whitespace

else:
_LOGGER.info("Loading wireless clients...")
client_list_url = '{}/monitor/allActiveClients'
.format(base_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.

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))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

missing whitespace around operator

@fabaff fabaff changed the base branch from master to dev July 9, 2018 16:05
@fabaff fabaff changed the base branch from dev to master July 9, 2018 16:06
Copy link
Copy Markdown
Member

@fabaff fabaff left a comment

Choose a reason for hiding this comment

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

This needs to point to dev.

@fabaff
Copy link
Copy Markdown
Member

fabaff commented Jul 9, 2018

Also, here apply the same as mentioned in this comment.

@balloob
Copy link
Copy Markdown
Member

balloob commented Jul 12, 2018

Going to close this. Please open a new PR when you based off the right branch

@balloob balloob closed this Jul 12, 2018
@ghost ghost removed the in progress label Jul 12, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed core integration: device_tracker merging-to-master This PR is merging into the master branch and should probably change the branch to `dev`.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants