diff --git a/src/components/ha-control-circular-slider.ts b/src/components/ha-control-circular-slider.ts
index 3f6344647d07..af9a7cf469d3 100644
--- a/src/components/ha-control-circular-slider.ts
+++ b/src/components/ha-control-circular-slider.ts
@@ -66,6 +66,9 @@ export class HaControlCircularSlider extends LitElement {
@property({ type: Boolean, reflect: true })
public disabled = false;
+ @property({ type: Boolean, reflect: true })
+ public readonly = false;
+
@property({ type: Boolean })
public dual?: boolean;
@@ -258,7 +261,7 @@ export class HaControlCircularSlider extends LitElement {
e.srcEvent.preventDefault();
});
this._mc.on("panstart", (e) => {
- if (this.disabled) return;
+ if (this.disabled || this.readonly) return;
const percentage = this._getPercentageFromEvent(e);
const raw = this._percentageToValue(percentage);
this._activeSlider = this._findActiveSlider(raw);
@@ -266,11 +269,11 @@ export class HaControlCircularSlider extends LitElement {
this.shadowRoot?.getElementById("#slider")?.focus();
});
this._mc.on("pancancel", () => {
- if (this.disabled) return;
+ if (this.disabled || this.readonly) return;
this._activeSlider = undefined;
});
this._mc.on("panmove", (e) => {
- if (this.disabled) return;
+ if (this.disabled || this.readonly) return;
const percentage = this._getPercentageFromEvent(e);
const raw = this._percentageToValue(percentage);
const bounded = this._boundedValue(raw);
@@ -281,7 +284,7 @@ export class HaControlCircularSlider extends LitElement {
}
});
this._mc.on("panend", (e) => {
- if (this.disabled) return;
+ if (this.disabled || this.readonly) return;
const percentage = this._getPercentageFromEvent(e);
const raw = this._percentageToValue(percentage);
const bounded = this._boundedValue(raw);
@@ -296,7 +299,7 @@ export class HaControlCircularSlider extends LitElement {
this._activeSlider = undefined;
});
this._mc.on("singletap", (e) => {
- if (this.disabled) return;
+ if (this.disabled || this.readonly) return;
const percentage = this._getPercentageFromEvent(e);
const raw = this._percentageToValue(percentage);
this._activeSlider = this._findActiveSlider(raw);
@@ -436,11 +439,15 @@ export class HaControlCircularSlider extends LitElement {
? current <= target
: false;
- const activeArc = showActive
- ? mode === "end"
- ? this._strokeDashArc(target, current)
- : this._strokeDashArc(current, target)
- : this._strokeCircleDashArc(target);
+ const showTarget = value != null;
+
+ const activeArc = showTarget
+ ? showActive
+ ? mode === "end"
+ ? this._strokeDashArc(target, current)
+ : this._strokeDashArc(current, target)
+ : this._strokeCircleDashArc(target)
+ : undefined;
const coloredArc =
mode === "full"
@@ -449,7 +456,9 @@ export class HaControlCircularSlider extends LitElement {
? this._strokeDashArc(target, limit)
: this._strokeDashArc(limit, target);
- const targetCircle = this._strokeCircleDashArc(target);
+ const targetCircle = showTarget
+ ? this._strokeCircleDashArc(target)
+ : undefined;
const currentCircle =
this.current != null &&
@@ -473,26 +482,33 @@ export class HaControlCircularSlider extends LitElement {
stroke-dasharray=${coloredArc[0]}
stroke-dashoffset=${coloredArc[1]}
/>
-
${this.hass.formatEntityState(this.stateObj)}
+ `; + } + const action = this.stateObj.attributes.hvac_action; const actionLabel = this.hass.formatEntityAttributeValue( @@ -383,15 +398,17 @@ export class HaMoreInfoClimateTemperature extends LitElement {${this.hass.formatEntityState(this.stateObj)}
+ `; + } + return html`${this.hass.localize( @@ -202,13 +213,20 @@ export class HaMoreInfoWaterHeaterTemperature extends LitElement { } return html` -