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

Display problem: passing by 0 at every value change #33

Closed
browetd opened this issue Jun 4, 2020 · 14 comments
Closed

Display problem: passing by 0 at every value change #33

browetd opened this issue Jun 4, 2020 · 14 comments

Comments

@browetd
Copy link

browetd commented Jun 4, 2020

Running HA 0.110.4 and canvas 0.4... Display problem, when the value changes, the ticker is moving to 0 before displaying the correct value... I can send you a small screen recording if necessary (file type not supported here). The problem seems only linked with Google Chrome (with Firefox, I do not have that behavior).

Sans titre

@balthisar
Copy link

Confirming that the issue occurs in Safari on mobile and desktop, too.

@balthisar
Copy link

Adding animation: false is a workaround. I presume at some point, the value is being set to zero before being updated with the new value.

@Olen
Copy link
Contributor

Olen commented Jun 11, 2020

There is definitely something fishy with "animation" (and "animateOnInit") in 0.4.
Showing a 0 would display as "minValue" even if the gauge was having a negative minValue.
And other gauges would always point to "minValue" even if the number displayed in the box was correct.
Setting both "animation" and "animateOnInit" to false fixed this.

@Olen
Copy link
Contributor

Olen commented Nov 19, 2020

Link to upstream issue: Mikhus/canvas-gauges#106

@ipa64
Copy link

ipa64 commented Dec 21, 2020

Setting both "animation" and "animateOnInit" to false fixed this.
Sadly this workaround doesn't fix the issue, Safari on MacOs

@drax-uk
Copy link

drax-uk commented Jan 23, 2021

Yes, same thing happens to me on chrome. workaround works....but Animation would be great...

@rhadamantys
Copy link
Contributor

rhadamantys commented Mar 31, 2023

I think that issue should have been solved with PR#56.

@browetd
Copy link
Author

browetd commented Mar 31, 2023

Nope, I still have the issue even on Firefox...
I am running version 0.6

@rhadamantys
Copy link
Contributor

rhadamantys commented Mar 31, 2023

Version 0.6 is from Feb/13. PR#56 has been created March/21. I guess, we need a new release.

@browetd
Copy link
Author

browetd commented Mar 31, 2023

Installed version 0.7 and problem still persists...

@rhadamantys
Copy link
Contributor

Can you try to open the page in private browser window? I remember I had some trouble with my browser cache during testing. Make sure, the new .js file is loaded.

@Olen
Copy link
Contributor

Olen commented Apr 3, 2023

It seems like the .js was not recreated for version 0.7. Look at the date.

image

As far as I can tell, this complied js does not include the changes.

Also, while investigating this, I discovered that the card version is imported from this file:
https://github.com/custom-cards/canvas-gauge-card/blob/a2b47e8147c541cba8d113f6f4cc7a346b37524b/src/const.ts

Which still contains 0.0.4, while this file https://github.com/custom-cards/canvas-gauge-card/blob/master/VERSION has the correct version in it.

image

@Olen
Copy link
Contributor

Olen commented Apr 3, 2023

I cloned the repo and ran a "npm install; npm run build" and then copied dist/canvas-gauge-card.js to config/www/community/canvas-gauge-card/canvas-gauge-card.js and deleted the ".js.gz" that hacs had created, and can confirm that thr fix seeems to work fine.

Changed all the

          animation: false
          animateOnInit: false

to true, and the gauges are now animated as expected.

@helto4real
Copy link
Collaborator

Later releases should fix the issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants