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 EBox sensor component #5135
Conversation
@titilambert, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob, @fabaff and @rmkraus to be potential reviewers. |
usage_data = {} | ||
# Get data | ||
for key, index in USAGE_MAP.items(): | ||
usage_data[key] = abs(float(span_list[index].text.strip().split()[0])) |
There was a problem hiding this comment.
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)
return False | ||
# Get percent | ||
try: | ||
home_data["usage"] = float(soup.find("div", {"id": "circleprogress_0"}).\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (85 > 79 characters)
the backslash is redundant between brackets
return False | ||
# Get balance | ||
try: | ||
home_data["balance"] = float(soup.find("div", {"class": "text_amount"}).text.split()[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (100 > 79 characters)
"upload": 7, | ||
"total": 8} | ||
|
||
def setup_platform(hass, config, add_devices, discovery_info=None): |
There was a problem hiding this comment.
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
|
||
_LOGGER = logging.getLogger(__name__) | ||
|
||
GIGABITS = "Gb" # type: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at least two spaces before inline comment
b9bf85f
to
025c01c
Compare
51b57c6
to
3b175c9
Compare
self._state = round(self.ebox_data.data[self.type], 2) | ||
|
||
|
||
class EBoxData(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This platform contains too much protocol specific details. Please extract into a 3rd party lib and base it upon that.
I'll close this for now. Please reopen when extracted as third party lib and updated the code. |
Description:
Add EBox sensor component.
EBox is an Internet provider in Canada.
This component uses https://client.ebox.ca
Note: This component will be updated once EBox releases their rest API
Pull request in home-assistant.github.io with documentation : home-assistant/home-assistant.io#1694
Example entry for
configuration.yaml
(if applicable):Checklist:
tox
run successfully. Your PR cannot be merged unless tests passREQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.