canvas-gauge-card icon indicating copy to clipboard operation
canvas-gauge-card copied to clipboard

Display problem: passing by 0 at every value change

Open browetd opened this issue 4 years ago • 6 comments

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

browetd avatar Jun 04 '20 02:06 browetd

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

balthisar avatar Jun 04 '20 16:06 balthisar

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.

balthisar avatar Jun 04 '20 17:06 balthisar

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 avatar Jun 11 '20 08:06 Olen

Link to upstream issue: https://github.com/Mikhus/canvas-gauges/issues/106

Olen avatar Nov 19 '20 13:11 Olen

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

ipa64 avatar Dec 21 '20 06:12 ipa64

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

drax-uk avatar Jan 23 '21 12:01 drax-uk

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

rhadamantys avatar Mar 31 '23 07:03 rhadamantys

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

browetd avatar Mar 31 '23 07:03 browetd

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

rhadamantys avatar Mar 31 '23 07:03 rhadamantys

Installed version 0.7 and problem still persists...

browetd avatar Mar 31 '23 20:03 browetd

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.

rhadamantys avatar Apr 01 '23 19:04 rhadamantys

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 avatar Apr 03 '23 07:04 Olen

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.

Olen avatar Apr 03 '23 10:04 Olen

Later releases should fix the issues

helto4real avatar Apr 10 '23 11:04 helto4real