@@ -3,10 +3,11 @@ import { PowerFlowCardPlus } from "../power-flow-card-plus";
3
3
import { displayValue } from "../utils/displayValue" ;
4
4
import { generalSecondarySpan } from "./spans/generalSecondarySpan" ;
5
5
import { TemplatesObj } from "../type" ;
6
- import { ConfigEntities } from "../power-flow-card-plus-config" ;
6
+ import { ConfigEntities , PowerFlowCardPlusConfig } from "../power-flow-card-plus-config" ;
7
7
8
8
export const gridElement = (
9
9
main : PowerFlowCardPlus ,
10
+ config : PowerFlowCardPlusConfig ,
10
11
{ entities, grid, templatesObj } : { entities : ConfigEntities ; grid : any ; templatesObj : TemplatesObj }
11
12
) => {
12
13
return html `< div class ="circle-container grid ">
@@ -35,7 +36,7 @@ export const gridElement = (
35
36
}
36
37
} }
37
38
>
38
- ${ generalSecondarySpan ( main . hass , main , templatesObj , grid , "grid" ) }
39
+ ${ generalSecondarySpan ( main . hass , main , config , templatesObj , grid , "grid" ) }
39
40
< ha-icon .icon =${ grid . icon } > </ ha-icon >
40
41
${ ( entities . grid ?. display_state === "two_way" ||
41
42
entities . grid ?. display_state === undefined ||
@@ -57,7 +58,8 @@ export const gridElement = (
57
58
} }
58
59
>
59
60
< ha-icon class ="small " .icon =${ "mdi:arrow-left" } > </ ha-icon >
60
- ${ displayValue ( main . hass , grid . state . toGrid ) }
61
+
62
+ ${ displayValue ( main . hass , grid . state . toGrid , grid . unit , grid . unit_white_space , grid . decimals , undefined , config . watt_threshold ) }
61
63
</ span > `
62
64
: null }
63
65
${ ( ( entities . grid ?. display_state === "two_way" ||
@@ -80,7 +82,8 @@ export const gridElement = (
80
82
}
81
83
} }
82
84
>
83
- < ha-icon class ="small " .icon =${ "mdi:arrow-right" } > </ ha-icon > ${ displayValue ( main . hass , grid . state . fromGrid ) }
85
+ < ha-icon class ="small " .icon =${ "mdi:arrow-right" } > </ ha-icon >
86
+ ${ displayValue ( main . hass , grid . state . fromGrid , grid . unit , grid . unit_white_space , grid . decimals , undefined , config . watt_threshold ) }
84
87
</ span > `
85
88
: "" }
86
89
${ grid . powerOutage ?. isOutage && ! grid . powerOutage ?. entityGenerator ? html `< span class ="grid power-outage "> ${ grid . powerOutage . name } </ span > ` : "" }
0 commit comments