ha-card-waze-travel-time icon indicating copy to clipboard operation
ha-card-waze-travel-time copied to clipboard

Clicking route makes waze page crash

Open WesSec opened this issue 4 years ago • 1 comments

Hi,

I just installed your card, and when I click a route to open it in Waze maps (Firefox 77, Win10) the website crashes. It looks like it tries to refresh the page a gazillion times. I cannot find any logs which are related, i hope you can reproduce it. I see the &time=now flickering in the URL bar when the page tries to load, this might be related.

My card config:

columns:
  - from
  - to
  - duration
  - distance
destinations:
  - entity: sensor.home_to_work
    from: Home
    to: Work
name: Travel Time
type: 'custom:ha-card-waze-travel-time'
unit: km

My sensor:

- platform: waze_travel_time
  name: Home to Work
  origin: zone.home
  destination: zone.work
  region: 'EU'

Cheers!

WesSec avatar Jun 22 '20 13:06 WesSec

I just did some more research and found that the URL has changed, most likely causing the issue

in the code

https://www.waze.com/ul?navigate=yes&ll=${state.destination.lat}%2C${state.destination.long}&from=${state.origin.lat}%2C${state.origin.long}&at=now

used by waze in the browser

https://www.waze.com/nl/livemap/directions?navigate=yes&to=ll.<dest.lat>%2C<dest.lon>&from=ll.<src.lat>%2C<src.lon>&time=now

I do not have a testing environment so I'm unable to test it and create a PR.

WesSec avatar Jul 06 '20 11:07 WesSec