Olen / lovelace-flower-card

Lovelace Flower Card to match the custom plant integration
https://github.com/Olen/homeassistant-plant/
177 stars 29 forks source link

Card use default round value #101

Closed Olegz73 closed 6 months ago

Olegz73 commented 6 months ago

Card use default round value. See screenshots. In settings round 27 , but card shows 27.2223455 Home assistant 2024.3.1

Screenshot_2024-03-17-20-13-35-559_io homeassistant companion android-edit Screenshot_2024-03-17-20-15-41-177_io homeassistant companion android-edit Screenshot_2024-03-17-20-15-56-684_io homeassistant companion android

Olen commented 6 months ago

Sorry, thought this was an easy fix, but it turns out that custom-card-helpers don't have these functions (yet).

Olen commented 6 months ago

I really don't understand why the fix is not working.

I basically tried to implement the same solution as here: https://github.com/grillp/homeassistant-power-distribution-card/blob/abae7e81578409ba0ee10af97cfaf32c117f24ce/src/card.ts#L162

But for some reason, npm build fails here with

[tsl] ERROR in /home/runner/work/lovelace-flower-card/lovelace-flower-card/src/utils/attributes.ts(60,38)
      TS2[33](https://github.com/Olen/lovelace-flower-card/actions/runs/8536573655/job/23385362904#step:8:34)9: Property 'formatEntityState' does not exist on type 'HomeAssistant'.

Someone with more knowledge on frontend development might see the obvious solution...

Olen commented 6 months ago

Finally got it.

Should be fine in the latest beta (beta10 (!)). Will release a new version soon.