nilstgmd / hvv-card

Custom Home Assistant card showing HVV departures 🚝
MIT License
5 stars 8 forks source link

Fix: Show delay in minutes #8

Closed N1c093 closed 1 year ago

N1c093 commented 1 year ago

As you can see in issue #7 the delay is currently shown in seconds and not in minutes. To fix this issue I changed the delay to minutes.

lirand84 commented 1 year ago

As you can see in issue #7 the delay is currently shown in seconds and not in minutes. To fix this issue I changed the delay to minutes.

Hello @N1c093, I changed the code lines in /www/community/hvv-card/hvv-card.js. Unfortunately, the delay is still displayed in seconds. Is there a way to update the hvv card without having to adapt the code? Thank you in advance!

guidocioni commented 1 year ago

As you can see in issue #7 the delay is currently shown in seconds and not in minutes. To fix this issue I changed the delay to minutes.

Hello @N1c093, I changed the code lines in /www/community/hvv-card/hvv-card.js. Unfortunately, the delay is still displayed in seconds. Is there a way to update the hvv card without having to adapt the code? Thank you in advance!

You may need to clear the cache of your browser to make sure that it is loading the updated js code

N1c093 commented 1 year ago

As you can see in issue #7 the delay is currently shown in seconds and not in minutes. To fix this issue I changed the delay to minutes.

Hello @N1c093, I changed the code lines in /www/community/hvv-card/hvv-card.js. Unfortunately, the delay is still displayed in seconds. Is there a way to update the hvv card without having to adapt the code? Thank you in advance!

Sorry for the late reply, I'm currently on vacation.

You also have to modify the path of the "Dashboard resources" : https://my.home-assistant.io/redirect/lovelace_resources/

I modified it to this path: /local/community/hvv-card/hvv-card.js?v=1

I can write you a short guide after my vacation, if this are to less information. Just give me a short feedback.

lirand84 commented 1 year ago

Wie Sie in Ausgabe 7 sehen können, wird die Verzögerung derzeit in Sekunden und nicht in Minuten angezeigt.Um dieses Problem zu beheben, habe ich die Verzögerung auf Minuten geändert.

Hallo @N1c093, ich habe die Codezeilen in /www/community/hvv-card/hvv-card.js geändert. Leider wird die Verzögerung immer noch in Sekunden angezeigt. Gibt es eine Möglichkeit, die hvv-Karte zu aktualisieren, ohne den Code anpassen zu müssen? Vielen Dank im Voraus!

Möglicherweise müssen Sie den Cache Ihres Browsers löschen, um sicherzustellen, dass der aktualisierte js-Code geladen wird

@guidocioni Thanks for the answer. Unfortunately didn't help.

lirand84 commented 1 year ago

As you can see in issue #7 the delay is currently shown in seconds and not in minutes. To fix this issue I changed the delay to minutes.

Hello @N1c093, I changed the code lines in /www/community/hvv-card/hvv-card.js. Unfortunately, the delay is still displayed in seconds. Is there a way to update the hvv card without having to adapt the code? Thank you in advance!

Sorry for the late reply, I'm currently on vacation.

You also have to modify the path of the "Dashboard resources" : https://my.home-assistant.io/redirect/lovelace_resources/

I modified it to this path: /local/community/hvv-card/hvv-card.js?v=1

I can write you a short guide after my vacation, if this are to less information. Just give me a short feedback.

@N1c093 Thanks for the answer. In /config/lovelace/resources I deleted this path /hacsfiles/hvv-card/hvv-card.js?hacstag=3... and the path /local/community/hvv-card/hvv-card.js?v =1 added. HA restarted. Unfortunately, the delay is still displayed in seconds. I would be very grateful for detailed instructions.

guidocioni commented 1 year ago

unfortunately I'm not an expert of home assistant as I just installed it yesterday, but i think it depends on the installation that you have. In my case I first installed the card + integration, modified the JavaScript code with this pr, then add the path to the Js file as dashboard resource and, without even restarting home assistant, I could see the delay in minute. I just had to delete the cache because at first the browser was loading the old js code. One way to check that would be to open the developer options of chrome and check the content of hvv-card.js. You should see the one with the minutes correction.

N1c093 commented 1 year ago

As you can see in issue #7 the delay is currently shown in seconds and not in minutes. To fix this issue I changed the delay to minutes.

Hello @N1c093, I changed the code lines in /www/community/hvv-card/hvv-card.js. Unfortunately, the delay is still displayed in seconds. Is there a way to update the hvv card without having to adapt the code? Thank you in advance!

Sorry for the late reply, I'm currently on vacation. You also have to modify the path of the "Dashboard resources" : https://my.home-assistant.io/redirect/lovelace_resources/ I modified it to this path: /local/community/hvv-card/hvv-card.js?v=1 I can write you a short guide after my vacation, if this are to less information. Just give me a short feedback.

@N1c093 Thanks for the answer. In /config/lovelace/resources I deleted this path /hacsfiles/hvv-card/hvv-card.js?hacstag=3... and the path /local/community/hvv-card/hvv-card.js?v =1 added. HA restarted. Unfortunately, the delay is still displayed in seconds. I would be very grateful for detailed instructions.

Here is my short instruction.

After this moification the newest javascript file should be loaded and you can see the delay in minutes.

lirand84 commented 1 year ago

Hello @N1c093, thanks for the instructions. I've done it exactly like this before. I think i have another problem. Following your instructions, I replaced the file in /www/community/hvv-card/ and changed the resource. After that I looked at the source code in the Incognito tab in Chrome. It was still the old code. Bildschirm­foto 2022-12-20 um 15 06 34 Bildschirm­foto 2022-12-20 um 15 07 45 Bildschirm­foto 2022-12-20 um 15 19 47

N1c093 commented 1 year ago

Hello @N1c093, thanks for the instructions. I've done it exactly like this before. I think i have another problem. Following your instructions, I replaced the file in /www/community/hvv-card/ and changed the resource. After that I looked at the source code in the Incognito tab in Chrome. It was still the old code.

You could also try to use another version in the lovelace resources. For example /local/community/hvv-card/hvv-card.js?v=1.99 Maybe this helps to load the newest javascript file.

guidocioni commented 1 year ago

Hello @N1c093, thanks for the instructions. I've done it exactly like this before. I think i have another problem. Following your instructions, I replaced the file in /www/community/hvv-card/ and changed the resource. After that I looked at the source code in the Incognito tab in Chrome. It was still the old code. Bildschirm­foto 2022-12-20 um 15 06 34 Bildschirm­foto 2022-12-20 um 15 07 45 Bildschirm­foto 2022-12-20 um 15 19 47

are you sure you've done a hard reload of the page?

lirand84 commented 1 year ago

I have now renamed the file from hvv-card.js to hvv-card1.js and changed resource to /local/community/hvv-card/hvv-card1.js. And that worked ))) Thanks @N1c093!

nilstgmd commented 1 year ago

@N1c093 sorry for the wait, if you resolve the merge conflicts I'll approve and release the change so it is also available through HACS. ty

N1c093 commented 1 year ago

@nilstgmd I created a new PR #10 Somehow I managed it to close this pullrequest, when I tried to resolve the merge conflicts 😄