-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
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
New deutsche_bahn component #1355
Conversation
This is an automated response to help you succeed in getting this PR merged.
If your code communicates with devices:
If your code does not depend on external devices:
|
when I run
I get
This also happens in the |
This line is wired: There are some other issues which makes the CI fail. lint runtests: commands[1] | pylint homeassistant
************* Module homeassistant.components.sensor.deutsche_bahn
W: 67, 0: Bad indentation. Found 12 spaces, expected 8 (bad-indentation)
C: 80, 0: Missing class docstring (missing-docstring)
C: 90, 4: Missing method docstring (missing-docstring)
W: 99,16: Specify string format arguments as logging function parameters (logging-not-lazy)
R: 80, 0: Too few public methods (1/2) (too-few-public-methods) |
This is a generic problem. We have most of time no assurances that an API will be available forever. Blockchain.info changed their API (#1242) and now the Bitcoin senor can not be used. |
The situation is a bit complicated. I run HA on Arch Linux witch comes with python 3.5. I want to use Z-Wave. There is a bug in Z-Wave so I can not use python 3.5 and thus I use a virtual env with python 3.4 to run HA. Since I'm developing I run everything from the clone of my git repo, but there is also a pip installed version on the system. Is this the problem? edit:
But I have nothing to to with a pswitch??? @fabaff okay, forget it my foo from old days got to solve this on my own |
Can somebody help me with the reason why Travis still fails? I tells me:
but by now I can run the |
@@ -153,6 +154,7 @@ omit = | |||
homeassistant/components/thermostat/homematic.py | |||
homeassistant/components/thermostat/proliphix.py | |||
homeassistant/components/thermostat/radiotherm.py | |||
|
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.
No need for this blank line
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.
okay removed it
So I passed the checks :) |
{'delay_departure': 0, | ||
'delay_arrival': 0}) | ||
if delay['delay_departure'] != 0: | ||
self._state += ''.join([' + ', str(delay['delay_departure'])]) |
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 must be the most complex string concatenation possible in Python. Try this:
self._state += " + {}".format(delay['delay_departure'])
You can only squash commits on your computer. Check out the branch locally, use And if all else fails, follow this xkcd |
👍 Okay, I follow this if it doesn't work. |
Uses the (schiene)[https://pypi.python.org/pypi/schiene/0.14] API to communicate with the webserver of bahn.de and pulls iformation about a specific connection from the (bahn.de)[http://www.bahn.de/p/view/index.shtml] webpage. The departure time of the next train for the given connection is shown. In case of delay, the delay is also shown. Additional `ATTRIBUTES` are used to inform about e.g. the type of the train, price and if it is ontime. Usage: sensor: platform: deutsche_bahn from: name_of_start_station to: name_of_final_station Problems: I'm testing it for quite some time, but I have never seen the `ATTRIBUTES` in case of a delayed train. The `ATTRIBUTES` are directly passed from the `schiene` API. So this usecase has not been tested yet. deutsche_bahn ist not supporting the `schiene` api unlike in the swiss_public_transport case. It's not guaranteed that `schiene` will work forever, infact it can happen that Bahn AG will intentionally brake the API at some point. In the past Bahn AG has not allways been very supportive to the opensource community.
All suggestions are in and it is squashed. I think it can be merged now. |
Nice! 🐬 |
Uses the schiene API to communicate with the web server of bahn.de
and pulls information about a specific connection from bahn.de
webpage. The departure time of the next train for the given connection is shown.
In case of delay, the delay is also shown. Additional
ATTRIBUTES
are used toinform about e.g. the type of the train, price and if it is ontime.
Usage:
Problems:
I'm testing it for quite some time, but I have never seen the
ATTRIBUTES
in caseof a delayed train. The
ATTRIBUTES
are directly passed from theschiene
API. So thisuse case has not been tested yet.
Bahn AG is not supporting the
schiene
api unlike in the case of swiss_public_transport.It's not guaranteed that
schiene
will work forever, in fact it can happen that Bahn AG willintentionally brake the API at some point. In the past Bahn AG has not always been very supportive
to the open source community.