Add here_travel_time#24603
Conversation
|
Hi, thanks for taking the time and for giving me feedback. I'm on vacation this week and will get back to you next Monday. |
|
I implemented the requested changes. While doing so I looked at the architecture discussion you linked and the other travel_time integrations and I too see a need/benefit for a travel time component. Lots of duplicate code and different naming conventions for the same stuff. I tried to follow the Waze implementation in order to have a common code base which can be refactored in the future. I would prefer to do this refactoring (creating a travel_time component) in a follow up PR as this will need more discussions and will impact more than one integration. |
|
You'll probably need to add tests to get this merged. |
|
How would these tests look like / what should be tested? |
|
Tests are not required, although appreciated, for integrations that communicates with devices or services. |
|
I am happy to provide them. Could you point me to a component test which you think might be a good starting point on how to do it properly? And thank you for the code, reviews and comments. I am really learning a lot here! |
|
The manual alarm control panel has test that set up the component, via I/O, api calls, should be patched as needed. |
|
I added the requested changes. Will work on tests after the weekend |
445f849 to
b74eb07
Compare
|
I released the component as a custom_component under https://github.com/eifinger/here_travel_time to gather some user feedback and did indeed find some bugs and missing features. Until I implement them and the tests I will close this PR and later reopen it again. |
|
if you add too many features and try to merge later on you might make it harder for yourself. It's always easier to merge something simple first just to get it in. Once the integration is there, it's easier to get updates merged to it in my experience.
…On Thu, Jul 18, 2019 at 8:50 AM Kevin Eifinger ***@***.***> wrote:
I released the component as a custom_component under
https://github.com/eifinger/here_travel_time to gather some user feedback
and did indeed find some bugs and missing features. Until I implement them
and the tests I will close this PR and later reopen it again.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#24603>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA7FQBMPSBBW22ETZEY5G4TQABRKXANCNFSM4HZCM2CQ>
.
|
|
I got to the tests faster than I thought. Let me know what I can improve, thank you! |
|
Reopen after following https://gist.github.com/robertpainsi/2c42c15f1ce6dab03a0675348edd4e2c |
f079541 to
af8025c
Compare
Switch route_mode and travel_mode in api request.
apply requested changes
123b69f to
b0cae59
Compare
|
Just the final comment left to resolve. Then we can merge! 🎉 |
|
Thanks for the dedicated work! Can be merged when build passes. |
|
Thank you for all the time and explanations! I learned a lot! |
|
@MartinHjelmare I thought the frontend would somehow parse/clean up the attribution message but it does not. The frontend shows the message as is with html tags. Is there anything I can do on the component side? |
|
I found another attribution source in Ottawa, CA. "sourceAttribution": {
"attribution": "With the support of <span class=\"company\"><a href=\"https://transit.api.here.com/r?appId=Mt1bOYh3m9uxE7r3wuUx&u=http://ottawa.ca/en/mobile-apps-and-open-data/open-data-terms-use\">OC Transpo</a></span>. All information is provided without warranty of any kind.",
"supplier": [
{
"title": "OC Transpo",
"href": "https://transit.api.here.com/r?appId=Mt1bOYh3m9uxE7r3wuUx&u=http://ottawa.ca/en/mobile-apps-and-open-data/open-data-terms-use",
"note": [
{
"type": "disclaimer",
"text": "<a href=\"https://transit.api.here.com/r?appId=Mt1bOYh3m9uxE7r3wuUx&u=http://ottawa.ca/en/mobile-apps-and-open-data/open-data-terms-use\">Includes content from OC Transpo: http://ottawa.ca/en/mobile-apps-and-open-data/open-data-terms-use</a>",
"href": "https://transit.api.here.com/r?appId=Mt1bOYh3m9uxE7r3wuUx&u=http://ottawa.ca/en/mobile-apps-and-open-data/open-data-terms-use",
"hrefText": "Includes content from OC Transpo: http://ottawa.ca/en/mobile-apps-and-open-data/open-data-terms-use"
}
]
}
]
}Following the link provided under I will add another commit which builds the attribution (if present) according to the |

Description:
This PR adds here_travel_time as a new component. It is based on the code of google_travel_time but uses the here api.
Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#9648
Example entry for
configuration.yaml(if applicable):Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
python3 -m script.hassfest.requirements_all.txtby runningpython3 -m script.gen_requirements_all..coveragerc.