diff --git a/src/panels/lovelace/editor/config-elements/hui-sensor-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-sensor-card-editor.ts
index d42fba0fb6..1fb42284fe 100644
--- a/src/panels/lovelace/editor/config-elements/hui-sensor-card-editor.ts
+++ b/src/panels/lovelace/editor/config-elements/hui-sensor-card-editor.ts
@@ -5,22 +5,24 @@ import "@polymer/paper-listbox/paper-listbox";
import {
customElement,
html,
+ internalProperty,
LitElement,
property,
- internalProperty,
TemplateResult,
} from "lit-element";
+import { assert, number, object, optional, string } from "superstruct";
import { fireEvent } from "../../../../common/dom/fire_event";
import { stateIcon } from "../../../../common/entity/state_icon";
import "../../../../components/entity/ha-entity-picker";
+import "../../../../components/ha-formfield";
import "../../../../components/ha-icon-input";
+import "../../../../components/ha-switch";
import { HomeAssistant } from "../../../../types";
import { SensorCardConfig } from "../../cards/types";
import "../../components/hui-theme-select-editor";
import { LovelaceCardEditor } from "../../types";
import { EditorTarget, EntitiesEditorEvent } from "../types";
import { configElementStyle } from "./config-elements-style";
-import { string, assert, object, optional, number } from "superstruct";
const cardConfigStruct = object({
type: string(),
@@ -68,8 +70,8 @@ export class HuiSensorCardEditor extends LitElement
return this._config!.unit || "";
}
- get _detail(): number | string {
- return this._config!.number || "1";
+ get _detail(): number {
+ return this._config!.detail ?? 1;
}
get _theme(): string {
@@ -97,10 +99,10 @@ export class HuiSensorCardEditor extends LitElement
"ui.panel.lovelace.editor.card.config.required"
)})"
.hass=${this.hass}
- .value="${this._entity}"
+ .value=${this._entity}
.configValue=${"entity"}
.includeDomains=${includeDomains}
- @change="${this._valueChanged}"
+ @change=${this._valueChanged}
allow-custom-entity
>