diff --git a/demo/public/assets/sections/images/media_player_family_room.jpg b/demo/public/assets/sections/images/media_player_family_room.jpg new file mode 100644 index 000000000000..e73833aa3051 Binary files /dev/null and b/demo/public/assets/sections/images/media_player_family_room.jpg differ diff --git a/demo/src/configs/sections/entities.ts b/demo/src/configs/sections/entities.ts index 1900624b8304..1bdb06f8a9ad 100644 --- a/demo/src/configs/sections/entities.ts +++ b/demo/src/configs/sections/entities.ts @@ -1,7 +1,7 @@ import { convertEntities } from "../../../../src/fake_data/entity"; import { DemoConfig } from "../types"; -export const demoEntitiesSections: DemoConfig["entities"] = () => +export const demoEntitiesSections: DemoConfig["entities"] = (localize) => convertEntities({ "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": { entity_id: "media_player.living_room_nest_mini", - state: "off", + state: "on", attributes: { device_class: "speaker", - friendly_name: "Living room Nest Mini", - 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.living_room_nest_mini" + ), + entity_picture: "/assets/sections/images/media_player_family_room.jpg", + supported_features: 64063, }, }, "cover.kitchen_shutter": { @@ -168,8 +187,27 @@ export const demoEntitiesSections: DemoConfig["entities"] = () => state: "on", attributes: { device_class: "speaker", - friendly_name: "Kitchen Nest Audio", - 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.kitchen_nest_audio" + ), + entity_picture: "/assets/sections/images/media_player_family_room.jpg", + supported_features: 64063, }, }, "binary_sensor.tesla_wall_connector_vehicle_connected": { @@ -333,8 +371,28 @@ export const demoEntitiesSections: DemoConfig["entities"] = () => entity_id: "media_player.study_nest_hub", state: "off", attributes: { - friendly_name: "Study Nest Hub", - supported_features: 152461, + device_class: "speaker", + 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": { diff --git a/demo/src/configs/sections/lovelace.ts b/demo/src/configs/sections/lovelace.ts index 36b4abb2fe9c..f09c0595c6da 100644 --- a/demo/src/configs/sections/lovelace.ts +++ b/demo/src/configs/sections/lovelace.ts @@ -1,7 +1,7 @@ import { isFrontpageEmbed } from "../../util/is_frontpage"; import { DemoConfig } from "../types"; -export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({ +export const demoLovelaceSections: DemoConfig["lovelace"] = (localize) => ({ title: "Home Assistant Demo", 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" }], }, ]), @@ -53,10 +53,9 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({ { type: "tile", 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", @@ -89,10 +88,9 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({ { type: "tile", entity: "media_player.kitchen_nest_audio", - name: "Nest Audio", }, ], - title: "👩‍🍳 Kitchen", + title: `👩‍🍳 ${localize("ui.panel.page-demo.config.sections.titles.kitchen")}`, }, { type: "grid", @@ -134,7 +132,7 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({ color: "dark-grey", }, ], - title: "⚡️ Energy", + title: `⚡️ ${localize("ui.panel.page-demo.config.sections.titles.energy")}`, }, { type: "grid", @@ -171,7 +169,7 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({ state_content: ["preset_mode", "current_temperature"], }, ], - title: "🌤️ Climate", + title: `🌤️ ${localize("ui.panel.page-demo.config.sections.titles.climate")}`, }, { type: "grid", @@ -189,7 +187,6 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({ { type: "tile", entity: "media_player.study_nest_hub", - name: "Nest Hub", }, { type: "tile", @@ -199,7 +196,7 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({ icon: "mdi:desk", }, ], - title: "🧑‍💻 Study", + title: `🧑‍💻 ${localize("ui.panel.page-demo.config.sections.titles.study")}`, }, { type: "grid", @@ -233,7 +230,7 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({ name: "Illuminance", }, ], - title: "🌳 Outdoor", + title: `🌳 ${localize("ui.panel.page-demo.config.sections.titles.outdoor")}`, }, { type: "grid", @@ -263,7 +260,7 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({ icon: "mdi:home-assistant", }, ], - title: "🎉 Updates", + title: `🎉 ${localize("ui.panel.page-demo.config.sections.titles.updates")}`, }, ], }, diff --git a/src/dialogs/more-info/controls/more-info-media_player.ts b/src/dialogs/more-info/controls/more-info-media_player.ts index 34971e593ba0..1cd8c228120d 100644 --- a/src/dialogs/more-info/controls/more-info-media_player.ts +++ b/src/dialogs/more-info/controls/more-info-media_player.ts @@ -63,8 +63,7 @@ class MoreInfoMediaPlayer extends LitElement { ` )} - ${!__DEMO__ && - !isUnavailableState(stateObj.state) && + ${!isUnavailableState(stateObj.state) && supportsFeature(stateObj, MediaPlayerEntityFeature.BROWSE_MEDIA) ? html`