mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
Don't show fractions in energy percentage gauges (#17140)
This commit is contained in:
parent
0735b6475a
commit
21caac4240
@ -21,6 +21,10 @@ import type { LovelaceCard } from "../../types";
|
||||
import { severityMap } from "../hui-gauge-card";
|
||||
import type { EnergyCarbonGaugeCardConfig } from "../types";
|
||||
|
||||
const FORMAT_OPTIONS = {
|
||||
maximumFractionDigits: 0,
|
||||
};
|
||||
|
||||
@customElement("hui-energy-carbon-consumed-gauge-card")
|
||||
class HuiEnergyCarbonGaugeCard
|
||||
extends SubscribeMixin(LitElement)
|
||||
@ -129,6 +133,7 @@ class HuiEnergyCarbonGaugeCard
|
||||
min="0"
|
||||
max="100"
|
||||
.value=${value}
|
||||
.formatOptions=${FORMAT_OPTIONS}
|
||||
.locale=${this.hass.locale}
|
||||
label="%"
|
||||
style=${styleMap({
|
||||
|
@ -19,6 +19,10 @@ import type { LovelaceCard } from "../../types";
|
||||
import { severityMap } from "../hui-gauge-card";
|
||||
import type { EnergySelfSufficiencyGaugeCardConfig } from "../types";
|
||||
|
||||
const FORMAT_OPTIONS = {
|
||||
maximumFractionDigits: 0,
|
||||
};
|
||||
|
||||
@customElement("hui-energy-self-sufficiency-gauge-card")
|
||||
class HuiEnergySelfSufficiencyGaugeCard
|
||||
extends SubscribeMixin(LitElement)
|
||||
@ -174,8 +178,9 @@ class HuiEnergySelfSufficiencyGaugeCard
|
||||
min="0"
|
||||
max="100"
|
||||
.value=${value}
|
||||
.locale=${this.hass.locale}
|
||||
label="%"
|
||||
.formatOptions=${FORMAT_OPTIONS}
|
||||
.locale=${this.hass.locale}
|
||||
style=${styleMap({
|
||||
"--gauge-color": this._computeSeverity(value),
|
||||
})}
|
||||
|
@ -19,6 +19,10 @@ import type { LovelaceCard } from "../../types";
|
||||
import { severityMap } from "../hui-gauge-card";
|
||||
import type { EnergySolarGaugeCardConfig } from "../types";
|
||||
|
||||
const FORMAT_OPTIONS = {
|
||||
maximumFractionDigits: 0,
|
||||
};
|
||||
|
||||
@customElement("hui-energy-solar-consumed-gauge-card")
|
||||
class HuiEnergySolarGaugeCard
|
||||
extends SubscribeMixin(LitElement)
|
||||
@ -109,8 +113,9 @@ class HuiEnergySolarGaugeCard
|
||||
min="0"
|
||||
max="100"
|
||||
.value=${value}
|
||||
.locale=${this.hass.locale}
|
||||
label="%"
|
||||
.formatOptions=${FORMAT_OPTIONS}
|
||||
.locale=${this.hass.locale}
|
||||
style=${styleMap({
|
||||
"--gauge-color": this._computeSeverity(value),
|
||||
})}
|
||||
|
Loading…
x
Reference in New Issue
Block a user