From dc6f1efffbe223dce8e0d2399e0b1aa7fca66a2c Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Thu, 19 Sep 2024 12:01:59 +0200 Subject: [PATCH] Add badges to section demo (#22029) --- demo/src/configs/sections/entities.ts | 30 ++++++++++++++++++++++++++- demo/src/configs/sections/lovelace.ts | 16 ++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/demo/src/configs/sections/entities.ts b/demo/src/configs/sections/entities.ts index 1bdb06f8a9..4ce452b787 100644 --- a/demo/src/configs/sections/entities.ts +++ b/demo/src/configs/sections/entities.ts @@ -111,9 +111,37 @@ export const demoEntitiesSections: DemoConfig["entities"] = (localize) => friendly_name: "Living room Temperature", }, }, + "sensor.outdoor_temperature": { + entity_id: "sensor.outdoor_temperature", + state: "10.5", + attributes: { + state_class: "measurement", + unit_of_measurement: "°C", + device_class: "temperature", + friendly_name: "Outdoor temperature", + }, + }, + "sensor.outdoor_humidity": { + entity_id: "sensor.outdoor_humidity", + state: "70.4", + attributes: { + state_class: "measurement", + unit_of_measurement: "%", + device_class: "humidity", + friendly_name: "Outdoor humidity", + }, + }, + "device_tracker.car": { + entity_id: "sensor.outdoor_humidity", + state: "not_home", + attributes: { + friendly_name: "Car", + icon: "mdi:car", + }, + }, "media_player.living_room_nest_mini": { entity_id: "media_player.living_room_nest_mini", - state: "on", + state: "playing", attributes: { device_class: "speaker", volume_level: 0.18, diff --git a/demo/src/configs/sections/lovelace.ts b/demo/src/configs/sections/lovelace.ts index f09c0595c6..5fa8597c6e 100644 --- a/demo/src/configs/sections/lovelace.ts +++ b/demo/src/configs/sections/lovelace.ts @@ -9,6 +9,22 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = (localize) => ({ title: isFrontpageEmbed ? "Home Assistant" : "Demo", path: "home", icon: "mdi:home-assistant", + badges: [ + { + type: "entity", + entity: "sensor.outdoor_temperature", + color: "red", + }, + { + type: "entity", + entity: "sensor.outdoor_humidity", + color: "indigo", + }, + { + type: "entity", + entity: "device_tracker.car", + }, + ], sections: [ ...(isFrontpageEmbed ? []