mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Tweak demo, add some translations, tweak media players (#21271)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
parent
1ceef7c3d3
commit
c07e1122e1
BIN
demo/public/assets/sections/images/media_player_family_room.jpg
Normal file
BIN
demo/public/assets/sections/images/media_player_family_room.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
@ -1,7 +1,7 @@
|
|||||||
import { convertEntities } from "../../../../src/fake_data/entity";
|
import { convertEntities } from "../../../../src/fake_data/entity";
|
||||||
import { DemoConfig } from "../types";
|
import { DemoConfig } from "../types";
|
||||||
|
|
||||||
export const demoEntitiesSections: DemoConfig["entities"] = () =>
|
export const demoEntitiesSections: DemoConfig["entities"] = (localize) =>
|
||||||
convertEntities({
|
convertEntities({
|
||||||
"cover.living_room_garden_shutter": {
|
"cover.living_room_garden_shutter": {
|
||||||
entity_id: "cover.living_room_garden_shutter",
|
entity_id: "cover.living_room_garden_shutter",
|
||||||
@ -113,11 +113,30 @@ export const demoEntitiesSections: DemoConfig["entities"] = () =>
|
|||||||
},
|
},
|
||||||
"media_player.living_room_nest_mini": {
|
"media_player.living_room_nest_mini": {
|
||||||
entity_id: "media_player.living_room_nest_mini",
|
entity_id: "media_player.living_room_nest_mini",
|
||||||
state: "off",
|
state: "on",
|
||||||
attributes: {
|
attributes: {
|
||||||
device_class: "speaker",
|
device_class: "speaker",
|
||||||
friendly_name: "Living room Nest Mini",
|
volume_level: 0.18,
|
||||||
supported_features: 152461,
|
is_volume_muted: false,
|
||||||
|
media_content_type: "music",
|
||||||
|
media_duration: 300,
|
||||||
|
media_position: 0,
|
||||||
|
media_position_updated_at: new Date(
|
||||||
|
// 23 seconds in
|
||||||
|
new Date().getTime() - 23000
|
||||||
|
).toISOString(),
|
||||||
|
media_title: "I Wasn't Born To Follow",
|
||||||
|
media_artist: "The Byrds",
|
||||||
|
media_album_name: "The Notorious Byrd Brothers",
|
||||||
|
source_list: ["It's A Party", "Radio HSL", "Retro 70s and 80s"],
|
||||||
|
shuffle: false,
|
||||||
|
night_sound: false,
|
||||||
|
speech_enhance: false,
|
||||||
|
friendly_name: localize(
|
||||||
|
"ui.panel.page-demo.config.sections.entities.media_player.living_room_nest_mini"
|
||||||
|
),
|
||||||
|
entity_picture: "/assets/sections/images/media_player_family_room.jpg",
|
||||||
|
supported_features: 64063,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"cover.kitchen_shutter": {
|
"cover.kitchen_shutter": {
|
||||||
@ -168,8 +187,27 @@ export const demoEntitiesSections: DemoConfig["entities"] = () =>
|
|||||||
state: "on",
|
state: "on",
|
||||||
attributes: {
|
attributes: {
|
||||||
device_class: "speaker",
|
device_class: "speaker",
|
||||||
friendly_name: "Kitchen Nest Audio",
|
volume_level: 0.18,
|
||||||
supported_features: 152461,
|
is_volume_muted: false,
|
||||||
|
media_content_type: "music",
|
||||||
|
media_duration: 300,
|
||||||
|
media_position: 0,
|
||||||
|
media_position_updated_at: new Date(
|
||||||
|
// 23 seconds in
|
||||||
|
new Date().getTime() - 23000
|
||||||
|
).toISOString(),
|
||||||
|
media_title: "I Wasn't Born To Follow",
|
||||||
|
media_artist: "The Byrds",
|
||||||
|
media_album_name: "The Notorious Byrd Brothers",
|
||||||
|
source_list: ["It's A Party", "Radio HSL", "Retro 70s and 80s"],
|
||||||
|
shuffle: false,
|
||||||
|
night_sound: false,
|
||||||
|
speech_enhance: false,
|
||||||
|
friendly_name: localize(
|
||||||
|
"ui.panel.page-demo.config.sections.entities.media_player.kitchen_nest_audio"
|
||||||
|
),
|
||||||
|
entity_picture: "/assets/sections/images/media_player_family_room.jpg",
|
||||||
|
supported_features: 64063,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"binary_sensor.tesla_wall_connector_vehicle_connected": {
|
"binary_sensor.tesla_wall_connector_vehicle_connected": {
|
||||||
@ -333,8 +371,28 @@ export const demoEntitiesSections: DemoConfig["entities"] = () =>
|
|||||||
entity_id: "media_player.study_nest_hub",
|
entity_id: "media_player.study_nest_hub",
|
||||||
state: "off",
|
state: "off",
|
||||||
attributes: {
|
attributes: {
|
||||||
friendly_name: "Study Nest Hub",
|
device_class: "speaker",
|
||||||
supported_features: 152461,
|
volume_level: 0.18,
|
||||||
|
is_volume_muted: false,
|
||||||
|
media_content_type: "music",
|
||||||
|
media_duration: 300,
|
||||||
|
media_position: 0,
|
||||||
|
media_position_updated_at: new Date(
|
||||||
|
// 23 seconds in
|
||||||
|
new Date().getTime() - 23000
|
||||||
|
).toISOString(),
|
||||||
|
media_title: "I Wasn't Born To Follow",
|
||||||
|
media_artist: "The Byrds",
|
||||||
|
media_album_name: "The Notorious Byrd Brothers",
|
||||||
|
source_list: ["It's A Party", "Radio HSL", "Retro 70s and 80s"],
|
||||||
|
shuffle: false,
|
||||||
|
night_sound: false,
|
||||||
|
speech_enhance: false,
|
||||||
|
friendly_name: localize(
|
||||||
|
"ui.panel.page-demo.config.sections.entities.media_player.study_nest_hub"
|
||||||
|
),
|
||||||
|
entity_picture: "/assets/sections/images/media_player_family_room.jpg",
|
||||||
|
supported_features: 64063,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"sensor.standing_desk_height": {
|
"sensor.standing_desk_height": {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { isFrontpageEmbed } from "../../util/is_frontpage";
|
import { isFrontpageEmbed } from "../../util/is_frontpage";
|
||||||
import { DemoConfig } from "../types";
|
import { DemoConfig } from "../types";
|
||||||
|
|
||||||
export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
export const demoLovelaceSections: DemoConfig["lovelace"] = (localize) => ({
|
||||||
title: "Home Assistant Demo",
|
title: "Home Assistant Demo",
|
||||||
views: [
|
views: [
|
||||||
{
|
{
|
||||||
@ -14,7 +14,7 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
|||||||
? []
|
? []
|
||||||
: [
|
: [
|
||||||
{
|
{
|
||||||
title: "Welcome 👋",
|
title: `${localize("ui.panel.page-demo.config.sections.titles.welcome")} 👋`,
|
||||||
cards: [{ type: "custom:ha-demo-card" }],
|
cards: [{ type: "custom:ha-demo-card" }],
|
||||||
},
|
},
|
||||||
]),
|
]),
|
||||||
@ -53,10 +53,9 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
|||||||
{
|
{
|
||||||
type: "tile",
|
type: "tile",
|
||||||
entity: "media_player.living_room_nest_mini",
|
entity: "media_player.living_room_nest_mini",
|
||||||
name: "Nest Mini",
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
title: "🛋️ Living room ",
|
title: `🛋️ ${localize("ui.panel.page-demo.config.sections.titles.living_room")} `,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "grid",
|
type: "grid",
|
||||||
@ -89,10 +88,9 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
|||||||
{
|
{
|
||||||
type: "tile",
|
type: "tile",
|
||||||
entity: "media_player.kitchen_nest_audio",
|
entity: "media_player.kitchen_nest_audio",
|
||||||
name: "Nest Audio",
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
title: "👩🍳 Kitchen",
|
title: `👩🍳 ${localize("ui.panel.page-demo.config.sections.titles.kitchen")}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "grid",
|
type: "grid",
|
||||||
@ -134,7 +132,7 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
|||||||
color: "dark-grey",
|
color: "dark-grey",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
title: "⚡️ Energy",
|
title: `⚡️ ${localize("ui.panel.page-demo.config.sections.titles.energy")}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "grid",
|
type: "grid",
|
||||||
@ -171,7 +169,7 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
|||||||
state_content: ["preset_mode", "current_temperature"],
|
state_content: ["preset_mode", "current_temperature"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
title: "🌤️ Climate",
|
title: `🌤️ ${localize("ui.panel.page-demo.config.sections.titles.climate")}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "grid",
|
type: "grid",
|
||||||
@ -189,7 +187,6 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
|||||||
{
|
{
|
||||||
type: "tile",
|
type: "tile",
|
||||||
entity: "media_player.study_nest_hub",
|
entity: "media_player.study_nest_hub",
|
||||||
name: "Nest Hub",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "tile",
|
type: "tile",
|
||||||
@ -199,7 +196,7 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
|||||||
icon: "mdi:desk",
|
icon: "mdi:desk",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
title: "🧑💻 Study",
|
title: `🧑💻 ${localize("ui.panel.page-demo.config.sections.titles.study")}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "grid",
|
type: "grid",
|
||||||
@ -233,7 +230,7 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
|||||||
name: "Illuminance",
|
name: "Illuminance",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
title: "🌳 Outdoor",
|
title: `🌳 ${localize("ui.panel.page-demo.config.sections.titles.outdoor")}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "grid",
|
type: "grid",
|
||||||
@ -263,7 +260,7 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
|||||||
icon: "mdi:home-assistant",
|
icon: "mdi:home-assistant",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
title: "🎉 Updates",
|
title: `🎉 ${localize("ui.panel.page-demo.config.sections.titles.updates")}`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -63,8 +63,7 @@ class MoreInfoMediaPlayer extends LitElement {
|
|||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
${!__DEMO__ &&
|
${!isUnavailableState(stateObj.state) &&
|
||||||
!isUnavailableState(stateObj.state) &&
|
|
||||||
supportsFeature(stateObj, MediaPlayerEntityFeature.BROWSE_MEDIA)
|
supportsFeature(stateObj, MediaPlayerEntityFeature.BROWSE_MEDIA)
|
||||||
? html`
|
? html`
|
||||||
<mwc-button
|
<mwc-button
|
||||||
|
@ -6630,7 +6630,24 @@
|
|||||||
},
|
},
|
||||||
"sections": {
|
"sections": {
|
||||||
"description": "This dashboard is using the sections view released in Home Assistant 2024.3. Learn more about it in this {blog_post}.",
|
"description": "This dashboard is using the sections view released in Home Assistant 2024.3. Learn more about it in this {blog_post}.",
|
||||||
"description_blog_post": "blog post"
|
"description_blog_post": "blog post",
|
||||||
|
"titles": {
|
||||||
|
"welcome": "Welcome",
|
||||||
|
"living_room": "Living room",
|
||||||
|
"study": "Study",
|
||||||
|
"kitchen": "Kitchen",
|
||||||
|
"outdoor": "Outdoor",
|
||||||
|
"energy": "Energy",
|
||||||
|
"climate": "Climate",
|
||||||
|
"updates": "Updates"
|
||||||
|
},
|
||||||
|
"entities": {
|
||||||
|
"media_player": {
|
||||||
|
"living_room_nest_mini": "Nest mini",
|
||||||
|
"kitchen_nest_audio": "Nest Audio",
|
||||||
|
"study_nest_hub": "Nest Hub"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user