junkfix / numberbox-card

Replace input_number sliders with plus and minus buttons
109 stars 9 forks source link

Add rounding in secondary info #95

Closed htmltiger closed 1 year ago

htmltiger commented 1 year ago

new feature https://github.com/htmltiger/numberbox-card/issues/94

eg. %climate.heating:attributes:current_temperature:~1

valantur commented 1 year ago

I just tried this but after adding :~1 the entity disappears. Not only the secondary info, but the whole entity. Code: secondary_info: 'Now: %sensor.thermostat_current_evening_temp:state:~1 °F'

By the way, thanks for taking the time to add this!

valantur commented 1 year ago

I hope this helps (taken from my browser's dev tools):

Uncaught (in promise) TypeError: b.toFixed is not a function at NumberBox.secondaryInfo (numberbox-card.js?hacstag=304967918412:112:51) at NumberBox.render (numberbox-card.js?hacstag=304967918412:55:12) at NumberBox.update (lit-element.ts:160:24) at NumberBox.performUpdate (reactive-element.ts:1331:14) at NumberBox.scheduleUpdate (reactive-element.ts:1263:17) at NumberBox._$Ej (reactive-element.ts:1235:25) at async ct (card-mod.js:1:18349) at async card-mod.js:5:2196

ildar170975 commented 1 year ago

the entity disappears. Not only the secondary info, but the whole entity.

Same.

type: entities
entities:
  - input_number.test_negative_11
  - type: custom:numberbox-card
    entity: input_number.test_negative_11
    name: html
    secondary_info: >-
      %input_number.test_negative_11:state:~1

изображение

And same error in Code inspector:

изображение

htmltiger commented 1 year ago

I hope 4.13 should fix the error.

ildar170975 commented 1 year ago

Seems to be fixed in my test, thank you!!! изображение