Use heading card in demo dashboard (#22193)

pull/22197/head
Paul Bottein 2024-10-02 16:13:26 +02:00 committed by GitHub
parent adbcdc62eb
commit ce9c5149d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 123 additions and 16 deletions

View File

@ -111,6 +111,16 @@ export const demoEntitiesSections: DemoConfig["entities"] = (localize) =>
friendly_name: "Living room Temperature", friendly_name: "Living room Temperature",
}, },
}, },
"sensor.living_room_humidity": {
entity_id: "sensor.living_room_humidity",
state: "57",
attributes: {
state_class: "measurement",
unit_of_measurement: "%",
device_class: "humidity",
friendly_name: "Living room Humidity",
},
},
"sensor.outdoor_temperature": { "sensor.outdoor_temperature": {
entity_id: "sensor.outdoor_temperature", entity_id: "sensor.outdoor_temperature",
state: "10.5", state: "10.5",
@ -189,6 +199,14 @@ export const demoEntitiesSections: DemoConfig["entities"] = (localize) =>
supported_features: 32, supported_features: 32,
}, },
}, },
"binary_sensor.kitchen_motion": {
entity_id: "light.kitchen_motion",
state: "on",
attributes: {
device_class: "motion",
friendly_name: "Kitchen motion",
},
},
"light.worktop_spotlights": { "light.worktop_spotlights": {
entity_id: "light.worktop_spotlights", entity_id: "light.worktop_spotlights",
state: "off", state: "off",
@ -423,6 +441,14 @@ export const demoEntitiesSections: DemoConfig["entities"] = (localize) =>
supported_features: 64063, supported_features: 64063,
}, },
}, },
"switch.in_meeting": {
entity_id: "switch.in_meeting",
state: "on",
attributes: {
icon: "mdi:laptop-account",
friendly_name: "In a meeting",
},
},
"sensor.standing_desk_height": { "sensor.standing_desk_height": {
entity_id: "sensor.standing_desk_height", entity_id: "sensor.standing_desk_height",
state: "72", state: "72",

View File

@ -30,12 +30,36 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = (localize) => ({
? [] ? []
: [ : [
{ {
title: `${localize("ui.panel.page-demo.config.sections.titles.welcome")} 👋`, cards: [
cards: [{ type: "custom:ha-demo-card" }], {
type: "heading",
heading: `${localize("ui.panel.page-demo.config.sections.titles.welcome")} 👋`,
},
{ type: "custom:ha-demo-card" },
],
}, },
]), ]),
{ {
cards: [ cards: [
{
type: "heading",
heading: localize(
"ui.panel.page-demo.config.sections.titles.living_room"
),
icon: "mdi:sofa",
badges: [
{
type: "entity",
entity: "sensor.living_room_temperature",
color: "red",
},
{
type: "entity",
entity: "sensor.living_room_humidity",
color: "indigo",
},
],
},
{ {
type: "tile", type: "tile",
entity: "light.floor_lamp", entity: "light.floor_lamp",
@ -54,13 +78,6 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = (localize) => ({
type: "tile", type: "tile",
entity: "light.bar_lamp", entity: "light.bar_lamp",
}, },
{
graph: "line",
type: "sensor",
entity: "sensor.living_room_temperature",
detail: 1,
name: "Temperature",
},
{ {
type: "tile", type: "tile",
entity: "cover.living_room_garden_shutter", entity: "cover.living_room_garden_shutter",
@ -71,11 +88,25 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = (localize) => ({
entity: "media_player.living_room_nest_mini", entity: "media_player.living_room_nest_mini",
}, },
], ],
title: `🛋️ ${localize("ui.panel.page-demo.config.sections.titles.living_room")} `,
}, },
{ {
type: "grid", type: "grid",
cards: [ cards: [
{
type: "heading",
heading: localize(
"ui.panel.page-demo.config.sections.titles.kitchen"
),
icon: "mdi:fridge",
badges: [
{
type: "entity",
entity: "binary_sensor.kitchen_motion",
show_state: false,
color: "blue",
},
],
},
{ {
type: "tile", type: "tile",
entity: "cover.kitchen_shutter", entity: "cover.kitchen_shutter",
@ -106,11 +137,17 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = (localize) => ({
entity: "media_player.kitchen_nest_audio", entity: "media_player.kitchen_nest_audio",
}, },
], ],
title: `👩‍🍳 ${localize("ui.panel.page-demo.config.sections.titles.kitchen")}`,
}, },
{ {
type: "grid", type: "grid",
cards: [ cards: [
{
type: "heading",
heading: localize(
"ui.panel.page-demo.config.sections.titles.energy"
),
icon: "mdi:transmission-tower",
},
{ {
type: "tile", type: "tile",
entity: "binary_sensor.tesla_wall_connector_vehicle_connected", entity: "binary_sensor.tesla_wall_connector_vehicle_connected",
@ -148,11 +185,17 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = (localize) => ({
color: "dark-grey", color: "dark-grey",
}, },
], ],
title: `⚡️ ${localize("ui.panel.page-demo.config.sections.titles.energy")}`,
}, },
{ {
type: "grid", type: "grid",
cards: [ cards: [
{
type: "heading",
heading: localize(
"ui.panel.page-demo.config.sections.titles.climate"
),
icon: "mdi:thermometer",
},
{ {
type: "tile", type: "tile",
entity: "sun.sun", entity: "sun.sun",
@ -185,16 +228,38 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = (localize) => ({
state_content: ["preset_mode", "current_temperature"], state_content: ["preset_mode", "current_temperature"],
}, },
], ],
title: `🌤️ ${localize("ui.panel.page-demo.config.sections.titles.climate")}`,
}, },
{ {
type: "grid", type: "grid",
cards: [ cards: [
{
type: "heading",
heading: localize(
"ui.panel.page-demo.config.sections.titles.study"
),
icon: "mdi:desk-lamp",
badges: [
{
type: "entity",
entity: "switch.in_meeting",
state: "on",
state_content: "name",
visibility: [
{
condition: "state",
state: "on",
entity: "switch.in_meeting",
},
],
},
],
},
{ {
type: "tile", type: "tile",
entity: "cover.study_shutter", entity: "cover.study_shutter",
name: "Shutter", name: "Shutter",
}, },
{ {
type: "tile", type: "tile",
entity: "light.study_spotlights", entity: "light.study_spotlights",
@ -211,12 +276,23 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = (localize) => ({
color: "brown", color: "brown",
icon: "mdi:desk", icon: "mdi:desk",
}, },
{
type: "tile",
entity: "switch.in_meeting",
name: "Meeting mode",
},
], ],
title: `🧑‍💻 ${localize("ui.panel.page-demo.config.sections.titles.study")}`,
}, },
{ {
type: "grid", type: "grid",
cards: [ cards: [
{
type: "heading",
heading: localize(
"ui.panel.page-demo.config.sections.titles.outdoor"
),
icon: "mdi:tree",
},
{ {
type: "tile", type: "tile",
entity: "light.outdoor_light", entity: "light.outdoor_light",
@ -246,11 +322,17 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = (localize) => ({
name: "Illuminance", name: "Illuminance",
}, },
], ],
title: `🌳 ${localize("ui.panel.page-demo.config.sections.titles.outdoor")}`,
}, },
{ {
type: "grid", type: "grid",
cards: [ cards: [
{
type: "heading",
heading: localize(
"ui.panel.page-demo.config.sections.titles.updates"
),
icon: "mdi:update",
},
{ {
type: "tile", type: "tile",
entity: "automation.home_assistant_auto_update", entity: "automation.home_assistant_auto_update",
@ -276,7 +358,6 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = (localize) => ({
icon: "mdi:home-assistant", icon: "mdi:home-assistant",
}, },
], ],
title: `🎉 ${localize("ui.panel.page-demo.config.sections.titles.updates")}`,
}, },
], ],
}, },