Skip to content
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

Fix london_underground issue #19642

Merged
merged 7 commits into from Dec 31, 2018
Merged

Fix london_underground issue #19642

merged 7 commits into from Dec 31, 2018

Conversation

robmarkcole
Copy link
Contributor

@robmarkcole robmarkcole commented Dec 29, 2018

Description:

Now using https://pypi.org/project/london-tube-status/

Related issue (if applicable): fixes #19639

reason = ' *** '.join(
[status['reason'] for status in line['lineStatuses']])
reason = ' *** '.join([status['disruption']['additionalInfo']
for status in line['lineStatuses']])

Choose a reason for hiding this comment

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

continuation line over-indented for visual indent

statuses = [status['statusSeverityDescription']
for status in line['lineStatuses']]
state = ' + '.join(sorted(set(statuses)))

if state == 'Good Service':
if state == 'Good Service': # if good status, this is the only status returned

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)

reason = ' *** '.join(
[status['reason'] for status in line['lineStatuses']])
reason = ' *** '.join([status['disruption']['additionalInfo']
for status in line['lineStatuses']])

Choose a reason for hiding this comment

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

continuation line under-indented for visual indent

@@ -127,7 +128,10 @@ def parse_api_response(response):
reason = 'Nothing to report'
else:
reason = ' *** '.join(
[status['reason'] for status in line['lineStatuses']])
[status['disruption']['additionalInfo'] for status
in line['lineStatuses']]

Choose a reason for hiding this comment

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

continuation line under-indented for visual indent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can anyone help here? Spent 15 mins trying this

@@ -127,7 +128,10 @@ def parse_api_response(response):
reason = 'Nothing to report'
else:
reason = ' *** '.join(
[status['reason'] for status in line['lineStatuses']])
[status['disruption']['additionalInfo'] for status

Choose a reason for hiding this comment

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

trailing whitespace

statuses = [status['statusSeverityDescription']
for status in line['lineStatuses']]
state = ' + '.join(sorted(set(statuses)))

if state == 'Good Service':
reason = 'Nothing to report'
else:
reason = ' *** '.join(
[status['reason'] for status in line['lineStatuses']])
reason = " *** ".join(
Copy link
Member

Choose a reason for hiding this comment

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

The service interface, I/O and data parsing, should be moved to a standalone library published on pypi.

https://developers.home-assistant.io/docs/en/creating_platform_code_review.html#6-communication-with-devices-services

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do

@robmarkcole
Copy link
Contributor Author

@MartinHjelmare changes made

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Good!

@MartinHjelmare MartinHjelmare merged commit ff80fc3 into home-assistant:dev Dec 31, 2018
@ghost ghost removed the in progress label Dec 31, 2018
@robmarkcole robmarkcole deleted the fix-tube branch December 31, 2018 14:25
@robmarkcole
Copy link
Contributor Author

Thanks!

@balloob balloob mentioned this pull request Jan 10, 2019
kellerza pushed a commit to kellerza/home-assistant that referenced this pull request Jan 18, 2019
* Update london_underground.py

* Update test

* Update london_underground.py

* Update london_underground.py

* Update london_underground.py

* Fix lint

* Use london-tube-status==0.2
alandtse pushed a commit to alandtse/home-assistant that referenced this pull request Feb 12, 2019
* Update london_underground.py

* Update test

* Update london_underground.py

* Update london_underground.py

* Update london_underground.py

* Fix lint

* Use london-tube-status==0.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

london_underground fails due to missing key
5 participants