File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11declare type StateValue = number | string | boolean ;
22
33interface Entity {
4- entity_id : string ;
5- device_id : string ;
6- }
4+ entity_id : string ;
5+ name ?: string ;
6+ icon ?: string ;
7+ device_id ?: string ;
8+ area_id ?: string ;
9+ labels : string [ ] ;
10+ hidden ?: boolean ;
11+ entity_category ?: EntityCategory ;
12+ translation_key ?: string ;
13+ platform ?: string ;
14+ display_precision ?: number ;
15+ has_entity_name ?: boolean ; }
716
817type Context = {
918 id : string ;
Original file line number Diff line number Diff line change @@ -295,11 +295,8 @@ export class StarlineCard extends HTMLElement {
295295 stateObj . attributes . unit_of_measurement = '' ;
296296 }
297297
298- const numState = Number ( stateObj . state ) ;
299- this . _info [ key ] . element ! . querySelector ( '.info-i-cnt' ) ! . textContent = this . _hass . formatEntityState (
300- stateObj ,
301- isFinite ( numState ) ? String ( Math . round ( numState ) ) : stateObj . state
302- ) ;
298+ this . _hass . entities [ stateObj . entity_id ] . display_precision = 0 ;
299+ this . _info [ key ] . element ! . querySelector ( '.info-i-cnt' ) ! . textContent = this . _hass . formatEntityState ( stateObj ) ;
303300 }
304301 }
305302
You can’t perform that action at this time.
0 commit comments