Skip to content

Commit

Permalink
Add unit for number tile feature (#18602)
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya authored Nov 10, 2023
1 parent d3f52f3 commit 9417f13
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/panels/lovelace/tile-features/hui-number-tile-feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ class HuiNumberTileFeature extends LitElement implements LovelaceTileFeature {
step=${stateObj.attributes.step}
@value-changed=${this._setValue}
.disabled=${isUnavailableState(stateObj.state)}
.unit=${stateObj.attributes.unit_of_measurement}
.locale=${this.hass.locale}
></ha-control-number-buttons>`
: html`<ha-control-slider
value=${stateObj.state}
Expand All @@ -94,6 +96,8 @@ class HuiNumberTileFeature extends LitElement implements LovelaceTileFeature {
step=${stateObj.attributes.step}
@value-changed=${this._setValue}
.disabled=${isUnavailableState(stateObj.state)}
.unit=${stateObj.attributes.unit_of_measurement}
.locale=${this.hass.locale}
></ha-control-slider>`}
</div>
`;
Expand Down

0 comments on commit 9417f13

Please sign in to comment.