mirror of
https://github.com/home-assistant/frontend.git
synced 2025-10-02 16:29:45 +00:00
Compare commits
73 Commits
20250926.0
...
loading-an
Author | SHA1 | Date | |
---|---|---|---|
![]() |
717af6be67 | ||
![]() |
bb8510bce9 | ||
![]() |
c46335c004 | ||
![]() |
5136c4b411 | ||
![]() |
77fdeb3378 | ||
![]() |
5d2ff600c7 | ||
![]() |
9232ec9eab | ||
![]() |
c1a879a548 | ||
![]() |
6e29a6ec86 | ||
![]() |
da6808d597 | ||
![]() |
de0953ed64 | ||
![]() |
2ff52c6c29 | ||
![]() |
d038e11170 | ||
![]() |
8925b39fe5 | ||
![]() |
beeef65506 | ||
![]() |
994c1b5751 | ||
![]() |
6823c647b6 | ||
![]() |
866b478dc0 | ||
![]() |
d746dc5752 | ||
![]() |
5f53e1e71c | ||
![]() |
3da82df093 | ||
![]() |
4cedfffb71 | ||
![]() |
1e1514e7da | ||
![]() |
60e07075bc | ||
![]() |
c998086474 | ||
![]() |
53be0a3fa2 | ||
![]() |
d69c46c80c | ||
![]() |
0c2a7bfed0 | ||
![]() |
afdd232e38 | ||
![]() |
179751a135 | ||
![]() |
52f6024306 | ||
![]() |
7c7a4e61f2 | ||
![]() |
facce7b016 | ||
![]() |
e546cb3374 | ||
![]() |
a0d2e7312b | ||
![]() |
c0a9dadcbe | ||
![]() |
e1edf7fb98 | ||
![]() |
6d5c165bd2 | ||
![]() |
54177a16e9 | ||
![]() |
c814b8e888 | ||
![]() |
33a0b32cc5 | ||
![]() |
7dae13bf57 | ||
![]() |
0a3fe6e0fb | ||
![]() |
e0348e4da7 | ||
![]() |
d53f3ec898 | ||
![]() |
e422547d93 | ||
![]() |
d91a3fbe85 | ||
![]() |
01d7130f22 | ||
![]() |
c57851e4df | ||
![]() |
6f1f13acb0 | ||
![]() |
a8abd00809 | ||
![]() |
e053978dbe | ||
![]() |
6e57f726a3 | ||
![]() |
b7cabadbe1 | ||
![]() |
d920217374 | ||
![]() |
1630263276 | ||
![]() |
5680c742be | ||
![]() |
2aeb9cf0ef | ||
![]() |
c9931b3a3c | ||
![]() |
fbf7ebdfe4 | ||
![]() |
52ccb03de5 | ||
![]() |
900236ac07 | ||
![]() |
28940c930d | ||
![]() |
e278b463fd | ||
![]() |
db2acd4e39 | ||
![]() |
6dcc52cd44 | ||
![]() |
981db50826 | ||
![]() |
09683863a7 | ||
![]() |
8c78f931dc | ||
![]() |
40ce3c1e31 | ||
![]() |
e430a1b1be | ||
![]() |
a2c6116417 | ||
![]() |
3239273f3e |
4
.github/workflows/cast_deployment.yaml
vendored
4
.github/workflows/cast_deployment.yaml
vendored
@@ -42,7 +42,7 @@ jobs:
|
|||||||
- name: Deploy to Netlify
|
- name: Deploy to Netlify
|
||||||
id: deploy
|
id: deploy
|
||||||
run: |
|
run: |
|
||||||
npx -y netlify-cli deploy --dir=cast/dist --alias dev
|
npx -y netlify-cli@23.7.3 deploy --dir=cast/dist --alias dev
|
||||||
env:
|
env:
|
||||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_CAST_SITE_ID }}
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_CAST_SITE_ID }}
|
||||||
@@ -77,7 +77,7 @@ jobs:
|
|||||||
- name: Deploy to Netlify
|
- name: Deploy to Netlify
|
||||||
id: deploy
|
id: deploy
|
||||||
run: |
|
run: |
|
||||||
npx -y netlify-cli deploy --dir=cast/dist --prod
|
npx -y netlify-cli@23.7.3 deploy --dir=cast/dist --prod
|
||||||
env:
|
env:
|
||||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_CAST_SITE_ID }}
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_CAST_SITE_ID }}
|
||||||
|
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
@@ -37,7 +37,7 @@ jobs:
|
|||||||
- name: Build resources
|
- name: Build resources
|
||||||
run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data gather-gallery-pages
|
run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data gather-gallery-pages
|
||||||
- name: Setup lint cache
|
- name: Setup lint cache
|
||||||
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
node_modules/.cache/prettier
|
node_modules/.cache/prettier
|
||||||
|
6
.github/workflows/codeql-analysis.yml
vendored
6
.github/workflows/codeql-analysis.yml
vendored
@@ -36,14 +36,14 @@ jobs:
|
|||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3
|
uses: github/codeql-action/init@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
|
||||||
with:
|
with:
|
||||||
languages: ${{ matrix.language }}
|
languages: ${{ matrix.language }}
|
||||||
|
|
||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3
|
uses: github/codeql-action/autobuild@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
# 📚 https://git.io/JvXDl
|
# 📚 https://git.io/JvXDl
|
||||||
@@ -57,4 +57,4 @@ jobs:
|
|||||||
# make release
|
# make release
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3
|
uses: github/codeql-action/analyze@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
|
||||||
|
4
.github/workflows/demo_deployment.yaml
vendored
4
.github/workflows/demo_deployment.yaml
vendored
@@ -43,7 +43,7 @@ jobs:
|
|||||||
- name: Deploy to Netlify
|
- name: Deploy to Netlify
|
||||||
id: deploy
|
id: deploy
|
||||||
run: |
|
run: |
|
||||||
npx -y netlify-cli deploy --dir=demo/dist --prod
|
npx -y netlify-cli@23.7.3 deploy --dir=demo/dist --prod
|
||||||
env:
|
env:
|
||||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEMO_DEV_SITE_ID }}
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEMO_DEV_SITE_ID }}
|
||||||
@@ -78,7 +78,7 @@ jobs:
|
|||||||
- name: Deploy to Netlify
|
- name: Deploy to Netlify
|
||||||
id: deploy
|
id: deploy
|
||||||
run: |
|
run: |
|
||||||
npx -y netlify-cli deploy --dir=demo/dist --prod
|
npx -y netlify-cli@23.7.3 deploy --dir=demo/dist --prod
|
||||||
env:
|
env:
|
||||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEMO_SITE_ID }}
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEMO_SITE_ID }}
|
||||||
|
2
.github/workflows/design_deployment.yaml
vendored
2
.github/workflows/design_deployment.yaml
vendored
@@ -35,7 +35,7 @@ jobs:
|
|||||||
- name: Deploy to Netlify
|
- name: Deploy to Netlify
|
||||||
id: deploy
|
id: deploy
|
||||||
run: |
|
run: |
|
||||||
npx -y netlify-cli deploy --dir=gallery/dist --prod
|
npx -y netlify-cli@23.7.3 deploy --dir=gallery/dist --prod
|
||||||
env:
|
env:
|
||||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_GALLERY_SITE_ID }}
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_GALLERY_SITE_ID }}
|
||||||
|
2
.github/workflows/design_preview.yaml
vendored
2
.github/workflows/design_preview.yaml
vendored
@@ -40,7 +40,7 @@ jobs:
|
|||||||
- name: Deploy preview to Netlify
|
- name: Deploy preview to Netlify
|
||||||
id: deploy
|
id: deploy
|
||||||
run: |
|
run: |
|
||||||
npx -y netlify-cli deploy --dir=gallery/dist --alias "deploy-preview-${{ github.event.number }}" \
|
npx -y netlify-cli@23.7.3 deploy --dir=gallery/dist --alias "deploy-preview-${{ github.event.number }}" \
|
||||||
--json > deploy_output.json
|
--json > deploy_output.json
|
||||||
env:
|
env:
|
||||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||||
|
2
.github/workflows/release.yaml
vendored
2
.github/workflows/release.yaml
vendored
@@ -75,7 +75,7 @@ jobs:
|
|||||||
|
|
||||||
# home-assistant/wheels doesn't support SHA pinning
|
# home-assistant/wheels doesn't support SHA pinning
|
||||||
- name: Build wheels
|
- name: Build wheels
|
||||||
uses: home-assistant/wheels@2025.07.0
|
uses: home-assistant/wheels@2025.09.1
|
||||||
with:
|
with:
|
||||||
abi: cp313
|
abi: cp313
|
||||||
tag: musllinux_1_2
|
tag: musllinux_1_2
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -6,4 +6,4 @@ enableGlobalCache: false
|
|||||||
|
|
||||||
nodeLinker: node-modules
|
nodeLinker: node-modules
|
||||||
|
|
||||||
yarnPath: .yarn/releases/yarn-4.10.2.cjs
|
yarnPath: .yarn/releases/yarn-4.10.3.cjs
|
||||||
|
@@ -5,17 +5,17 @@ const castContext = framework.CastReceiverContext.getInstance();
|
|||||||
const playerManager = castContext.getPlayerManager();
|
const playerManager = castContext.getPlayerManager();
|
||||||
|
|
||||||
playerManager.setMessageInterceptor(
|
playerManager.setMessageInterceptor(
|
||||||
"LOAD" as framework.messages.MessageType.LOAD,
|
framework.messages.MessageType.LOAD,
|
||||||
(loadRequestData) => {
|
(loadRequestData) => {
|
||||||
const media = loadRequestData.media;
|
const media = loadRequestData.media;
|
||||||
// Special handling if it came from Google Assistant
|
// Special handling if it came from Google Assistant
|
||||||
if (media.entity) {
|
if (media.entity) {
|
||||||
media.contentId = media.entity;
|
media.contentId = media.entity;
|
||||||
media.streamType = "LIVE" as framework.messages.StreamType.LIVE;
|
media.streamType = framework.messages.StreamType.LIVE;
|
||||||
media.contentType = "application/vnd.apple.mpegurl";
|
media.contentType = "application/vnd.apple.mpegurl";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
media.hlsVideoSegmentFormat =
|
media.hlsVideoSegmentFormat =
|
||||||
"fmp4" as framework.messages.HlsVideoSegmentFormat.FMP4;
|
framework.messages.HlsVideoSegmentFormat.FMP4;
|
||||||
}
|
}
|
||||||
return loadRequestData;
|
return loadRequestData;
|
||||||
}
|
}
|
||||||
|
@@ -75,7 +75,7 @@ export const castDemoEntities: () => Entity[] = () =>
|
|||||||
longitude: 4.8903147,
|
longitude: 4.8903147,
|
||||||
radius: 100,
|
radius: 100,
|
||||||
friendly_name: "Home",
|
friendly_name: "Home",
|
||||||
icon: "hass:home",
|
icon: "mdi:home",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"input_number.harmonyvolume": {
|
"input_number.harmonyvolume": {
|
||||||
@@ -88,7 +88,7 @@ export const castDemoEntities: () => Entity[] = () =>
|
|||||||
step: 1,
|
step: 1,
|
||||||
mode: "slider",
|
mode: "slider",
|
||||||
friendly_name: "Volume",
|
friendly_name: "Volume",
|
||||||
icon: "hass:volume-high",
|
icon: "mdi:volume-high",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"climate.upstairs": {
|
"climate.upstairs": {
|
||||||
|
@@ -56,7 +56,7 @@ export const castDemoLovelace: () => LovelaceConfig = () => {
|
|||||||
type: "weblink",
|
type: "weblink",
|
||||||
url: "/lovelace/climate",
|
url: "/lovelace/climate",
|
||||||
name: "Climate controls",
|
name: "Climate controls",
|
||||||
icon: "hass:arrow-right",
|
icon: "mdi:arrow-right",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -76,7 +76,7 @@ export const castDemoLovelace: () => LovelaceConfig = () => {
|
|||||||
type: "weblink",
|
type: "weblink",
|
||||||
url: "/lovelace/overview",
|
url: "/lovelace/overview",
|
||||||
name: "Back",
|
name: "Back",
|
||||||
icon: "hass:arrow-left",
|
icon: "mdi:arrow-left",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@@ -40,8 +40,7 @@ const playDummyMedia = (viewTitle?: string) => {
|
|||||||
loadRequestData.media.contentId =
|
loadRequestData.media.contentId =
|
||||||
"https://cast.home-assistant.io/images/google-nest-hub.png";
|
"https://cast.home-assistant.io/images/google-nest-hub.png";
|
||||||
loadRequestData.media.contentType = "image/jpeg";
|
loadRequestData.media.contentType = "image/jpeg";
|
||||||
loadRequestData.media.streamType =
|
loadRequestData.media.streamType = framework.messages.StreamType.NONE;
|
||||||
"NONE" as framework.messages.StreamType.NONE;
|
|
||||||
const metadata = new framework.messages.GenericMediaMetadata();
|
const metadata = new framework.messages.GenericMediaMetadata();
|
||||||
metadata.title = viewTitle;
|
metadata.title = viewTitle;
|
||||||
loadRequestData.media.metadata = metadata;
|
loadRequestData.media.metadata = metadata;
|
||||||
@@ -90,7 +89,7 @@ const showMediaPlayer = () => {
|
|||||||
const options = new framework.CastReceiverOptions();
|
const options = new framework.CastReceiverOptions();
|
||||||
options.disableIdleTimeout = true;
|
options.disableIdleTimeout = true;
|
||||||
options.customNamespaces = {
|
options.customNamespaces = {
|
||||||
[CAST_NS]: "json" as framework.system.MessageType.JSON,
|
[CAST_NS]: framework.system.MessageType.JSON,
|
||||||
};
|
};
|
||||||
|
|
||||||
castContext.addCustomMessageListener(
|
castContext.addCustomMessageListener(
|
||||||
@@ -98,7 +97,9 @@ castContext.addCustomMessageListener(
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
(ev: ReceivedMessage<HassMessage>) => {
|
(ev: ReceivedMessage<HassMessage>) => {
|
||||||
// We received a show Lovelace command, stop media from playing, hide media player and show Lovelace controller
|
// We received a show Lovelace command, stop media from playing, hide media player and show Lovelace controller
|
||||||
if (playerManager.getPlayerState() !== "IDLE") {
|
if (
|
||||||
|
playerManager.getPlayerState() !== framework.messages.PlayerState.IDLE
|
||||||
|
) {
|
||||||
playerManager.stop();
|
playerManager.stop();
|
||||||
} else {
|
} else {
|
||||||
showLovelaceController();
|
showLovelaceController();
|
||||||
@@ -112,7 +113,7 @@ castContext.addCustomMessageListener(
|
|||||||
const playerManager = castContext.getPlayerManager();
|
const playerManager = castContext.getPlayerManager();
|
||||||
|
|
||||||
playerManager.setMessageInterceptor(
|
playerManager.setMessageInterceptor(
|
||||||
"LOAD" as framework.messages.MessageType.LOAD,
|
framework.messages.MessageType.LOAD,
|
||||||
(loadRequestData) => {
|
(loadRequestData) => {
|
||||||
if (
|
if (
|
||||||
loadRequestData.media.contentId ===
|
loadRequestData.media.contentId ===
|
||||||
@@ -126,23 +127,24 @@ playerManager.setMessageInterceptor(
|
|||||||
// Special handling if it came from Google Assistant
|
// Special handling if it came from Google Assistant
|
||||||
if (media.entity) {
|
if (media.entity) {
|
||||||
media.contentId = media.entity;
|
media.contentId = media.entity;
|
||||||
media.streamType = "LIVE" as framework.messages.StreamType.LIVE;
|
media.streamType = framework.messages.StreamType.LIVE;
|
||||||
media.contentType = "application/vnd.apple.mpegurl";
|
media.contentType = "application/vnd.apple.mpegurl";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
media.hlsVideoSegmentFormat =
|
media.hlsVideoSegmentFormat =
|
||||||
"fmp4" as framework.messages.HlsVideoSegmentFormat.FMP4;
|
framework.messages.HlsVideoSegmentFormat.FMP4;
|
||||||
}
|
}
|
||||||
return loadRequestData;
|
return loadRequestData;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
playerManager.addEventListener(
|
playerManager.addEventListener(
|
||||||
"MEDIA_STATUS" as framework.events.EventType.MEDIA_STATUS,
|
framework.events.EventType.MEDIA_STATUS,
|
||||||
(event) => {
|
(event) => {
|
||||||
if (
|
if (
|
||||||
event.mediaStatus?.playerState === "IDLE" &&
|
event.mediaStatus?.playerState === framework.messages.PlayerState.IDLE &&
|
||||||
event.mediaStatus?.idleReason &&
|
event.mediaStatus?.idleReason &&
|
||||||
event.mediaStatus?.idleReason !== "INTERRUPTED"
|
event.mediaStatus?.idleReason !==
|
||||||
|
framework.messages.IdleReason.INTERRUPTED
|
||||||
) {
|
) {
|
||||||
// media finished or stopped, return to default Lovelace
|
// media finished or stopped, return to default Lovelace
|
||||||
showLovelaceController();
|
showLovelaceController();
|
||||||
|
@@ -143,7 +143,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
|
|||||||
state: "on",
|
state: "on",
|
||||||
attributes: {
|
attributes: {
|
||||||
friendly_name: "Home Automation",
|
friendly_name: "Home Automation",
|
||||||
icon: "hass:home-automation",
|
icon: "mdi:home-automation",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"input_boolean.tvtime": {
|
"input_boolean.tvtime": {
|
||||||
|
@@ -4,7 +4,7 @@ export const demoLovelaceArsaboo: DemoConfig["lovelace"] = (localize) => ({
|
|||||||
title: "Home Assistant",
|
title: "Home Assistant",
|
||||||
views: [
|
views: [
|
||||||
{
|
{
|
||||||
icon: "hass:home-assistant",
|
icon: "mdi:home-assistant",
|
||||||
id: "home",
|
id: "home",
|
||||||
title: "Home",
|
title: "Home",
|
||||||
cards: [
|
cards: [
|
||||||
|
@@ -1236,7 +1236,7 @@ export const demoLovelaceJimpower: DemoConfig["lovelace"] = () => ({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
path: "security",
|
path: "security",
|
||||||
icon: "hass:shield-home",
|
icon: "mdi:shield-home",
|
||||||
name: "Security",
|
name: "Security",
|
||||||
background:
|
background:
|
||||||
'center / cover no-repeat url("/assets/jimpower/background-15.jpg") fixed',
|
'center / cover no-repeat url("/assets/jimpower/background-15.jpg") fixed',
|
||||||
|
@@ -117,7 +117,7 @@ export class DemoHaBadge extends LitElement {
|
|||||||
}
|
}
|
||||||
.card-content {
|
.card-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 24px;
|
gap: var(--ha-space-6);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@@ -155,11 +155,11 @@ export class DemoHaButton extends LitElement {
|
|||||||
.card-content {
|
.card-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 24px;
|
gap: var(--ha-space-6);
|
||||||
}
|
}
|
||||||
.card-content div {
|
.card-content div {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@@ -123,11 +123,11 @@ export class DemoHaProgressButton extends LitElement {
|
|||||||
.card-content {
|
.card-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 24px;
|
gap: var(--ha-space-6);
|
||||||
}
|
}
|
||||||
.card-content div {
|
.card-content div {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@@ -88,7 +88,7 @@ export class DemoHaSlider extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 24px;
|
gap: var(--ha-space-6);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@@ -70,7 +70,7 @@ export class DemoHaSpinner extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 24px;
|
gap: var(--ha-space-6);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@@ -159,7 +159,7 @@ class HassioSystemManagedDialog extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 16px;
|
gap: var(--ha-space-4);
|
||||||
--mdc-icon-size: 48px;
|
--mdc-icon-size: 48px;
|
||||||
margin-bottom: 32px;
|
margin-bottom: 32px;
|
||||||
}
|
}
|
||||||
|
@@ -31,7 +31,7 @@ export const hassioStyle = css`
|
|||||||
.card-group {
|
.card-group {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||||
grid-gap: 8px;
|
grid-gap: var(--ha-space-2);
|
||||||
}
|
}
|
||||||
@media screen and (min-width: 640px) {
|
@media screen and (min-width: 640px) {
|
||||||
.card-group {
|
.card-group {
|
||||||
|
@@ -213,7 +213,7 @@ class HaLandingPage extends LandingPageBaseElement {
|
|||||||
ha-card .card-content {
|
ha-card .card-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 16px;
|
gap: var(--ha-space-4);
|
||||||
}
|
}
|
||||||
ha-alert p {
|
ha-alert p {
|
||||||
text-align: unset;
|
text-align: unset;
|
||||||
|
26
package.json
26
package.json
@@ -28,13 +28,13 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "7.28.4",
|
"@babel/runtime": "7.28.4",
|
||||||
"@braintree/sanitize-url": "7.1.1",
|
"@braintree/sanitize-url": "7.1.1",
|
||||||
"@codemirror/autocomplete": "6.18.7",
|
"@codemirror/autocomplete": "6.19.0",
|
||||||
"@codemirror/commands": "6.8.1",
|
"@codemirror/commands": "6.8.1",
|
||||||
"@codemirror/language": "6.11.3",
|
"@codemirror/language": "6.11.3",
|
||||||
"@codemirror/legacy-modes": "6.5.1",
|
"@codemirror/legacy-modes": "6.5.1",
|
||||||
"@codemirror/search": "6.5.11",
|
"@codemirror/search": "6.5.11",
|
||||||
"@codemirror/state": "6.5.2",
|
"@codemirror/state": "6.5.2",
|
||||||
"@codemirror/view": "6.38.2",
|
"@codemirror/view": "6.38.3",
|
||||||
"@date-fns/tz": "1.4.1",
|
"@date-fns/tz": "1.4.1",
|
||||||
"@egjs/hammerjs": "2.0.17",
|
"@egjs/hammerjs": "2.0.17",
|
||||||
"@formatjs/intl-datetimeformat": "6.18.0",
|
"@formatjs/intl-datetimeformat": "6.18.0",
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
"@fullcalendar/list": "6.1.19",
|
"@fullcalendar/list": "6.1.19",
|
||||||
"@fullcalendar/luxon3": "6.1.19",
|
"@fullcalendar/luxon3": "6.1.19",
|
||||||
"@fullcalendar/timegrid": "6.1.19",
|
"@fullcalendar/timegrid": "6.1.19",
|
||||||
"@home-assistant/webawesome": "3.0.0-beta.4.ha.3",
|
"@home-assistant/webawesome": "3.0.0-beta.6.ha.0",
|
||||||
"@lezer/highlight": "1.2.1",
|
"@lezer/highlight": "1.2.1",
|
||||||
"@lit-labs/motion": "1.0.9",
|
"@lit-labs/motion": "1.0.9",
|
||||||
"@lit-labs/observers": "2.0.6",
|
"@lit-labs/observers": "2.0.6",
|
||||||
@@ -89,8 +89,8 @@
|
|||||||
"@thomasloven/round-slider": "0.6.0",
|
"@thomasloven/round-slider": "0.6.0",
|
||||||
"@tsparticles/engine": "3.9.1",
|
"@tsparticles/engine": "3.9.1",
|
||||||
"@tsparticles/preset-links": "3.2.0",
|
"@tsparticles/preset-links": "3.2.0",
|
||||||
"@vaadin/combo-box": "24.9.0",
|
"@vaadin/combo-box": "24.9.1",
|
||||||
"@vaadin/vaadin-themable-mixin": "24.9.0",
|
"@vaadin/vaadin-themable-mixin": "24.9.1",
|
||||||
"@vibrant/color": "4.0.0",
|
"@vibrant/color": "4.0.0",
|
||||||
"@vue/web-component-wrapper": "1.3.0",
|
"@vue/web-component-wrapper": "1.3.0",
|
||||||
"@webcomponents/scoped-custom-element-registry": "0.0.10",
|
"@webcomponents/scoped-custom-element-registry": "0.0.10",
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
"fuse.js": "7.1.0",
|
"fuse.js": "7.1.0",
|
||||||
"google-timezones-json": "1.2.0",
|
"google-timezones-json": "1.2.0",
|
||||||
"gulp-zopfli-green": "6.0.2",
|
"gulp-zopfli-green": "6.0.2",
|
||||||
"hls.js": "1.6.12",
|
"hls.js": "1.6.13",
|
||||||
"home-assistant-js-websocket": "9.5.0",
|
"home-assistant-js-websocket": "9.5.0",
|
||||||
"idb-keyval": "6.2.2",
|
"idb-keyval": "6.2.2",
|
||||||
"intl-messageformat": "10.7.16",
|
"intl-messageformat": "10.7.16",
|
||||||
@@ -157,11 +157,11 @@
|
|||||||
"@octokit/auth-oauth-device": "8.0.1",
|
"@octokit/auth-oauth-device": "8.0.1",
|
||||||
"@octokit/plugin-retry": "8.0.1",
|
"@octokit/plugin-retry": "8.0.1",
|
||||||
"@octokit/rest": "22.0.0",
|
"@octokit/rest": "22.0.0",
|
||||||
"@rsdoctor/rspack-plugin": "1.2.3",
|
"@rsdoctor/rspack-plugin": "1.3.1",
|
||||||
"@rspack/core": "1.5.5",
|
"@rspack/core": "1.5.7",
|
||||||
"@rspack/dev-server": "1.1.4",
|
"@rspack/dev-server": "1.1.4",
|
||||||
"@types/babel__plugin-transform-runtime": "7.9.5",
|
"@types/babel__plugin-transform-runtime": "7.9.5",
|
||||||
"@types/chromecast-caf-receiver": "6.0.24",
|
"@types/chromecast-caf-receiver": "6.0.22",
|
||||||
"@types/chromecast-caf-sender": "1.0.11",
|
"@types/chromecast-caf-sender": "1.0.11",
|
||||||
"@types/color-name": "2.0.0",
|
"@types/color-name": "2.0.0",
|
||||||
"@types/culori": "4.0.1",
|
"@types/culori": "4.0.1",
|
||||||
@@ -203,7 +203,7 @@
|
|||||||
"husky": "9.1.7",
|
"husky": "9.1.7",
|
||||||
"jsdom": "27.0.0",
|
"jsdom": "27.0.0",
|
||||||
"jszip": "3.10.1",
|
"jszip": "3.10.1",
|
||||||
"lint-staged": "16.1.6",
|
"lint-staged": "16.2.1",
|
||||||
"lit-analyzer": "2.0.3",
|
"lit-analyzer": "2.0.3",
|
||||||
"lodash.merge": "4.6.2",
|
"lodash.merge": "4.6.2",
|
||||||
"lodash.template": "4.5.0",
|
"lodash.template": "4.5.0",
|
||||||
@@ -213,11 +213,11 @@
|
|||||||
"rspack-manifest-plugin": "5.1.0",
|
"rspack-manifest-plugin": "5.1.0",
|
||||||
"serve": "14.2.5",
|
"serve": "14.2.5",
|
||||||
"sinon": "21.0.0",
|
"sinon": "21.0.0",
|
||||||
"tar": "7.4.3",
|
"tar": "7.5.1",
|
||||||
"terser-webpack-plugin": "5.3.14",
|
"terser-webpack-plugin": "5.3.14",
|
||||||
"ts-lit-plugin": "2.0.2",
|
"ts-lit-plugin": "2.0.2",
|
||||||
"typescript": "5.9.2",
|
"typescript": "5.9.2",
|
||||||
"typescript-eslint": "8.44.0",
|
"typescript-eslint": "8.44.1",
|
||||||
"vite-tsconfig-paths": "5.1.4",
|
"vite-tsconfig-paths": "5.1.4",
|
||||||
"vitest": "3.2.4",
|
"vitest": "3.2.4",
|
||||||
"webpack-stats-plugin": "1.1.3",
|
"webpack-stats-plugin": "1.1.3",
|
||||||
@@ -235,5 +235,5 @@
|
|||||||
"tslib": "2.8.1",
|
"tslib": "2.8.1",
|
||||||
"@material/mwc-list@^0.27.0": "patch:@material/mwc-list@npm%3A0.27.0#~/.yarn/patches/@material-mwc-list-npm-0.27.0-5344fc9de4.patch"
|
"@material/mwc-list@^0.27.0": "patch:@material/mwc-list@npm%3A0.27.0#~/.yarn/patches/@material-mwc-list-npm-0.27.0-5344fc9de4.patch"
|
||||||
},
|
},
|
||||||
"packageManager": "yarn@4.10.2"
|
"packageManager": "yarn@4.10.3"
|
||||||
}
|
}
|
||||||
|
@@ -1,23 +1,40 @@
|
|||||||
|
import { formatHex, parse } from "culori";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Expands a 3-digit hex color to a 6-digit hex color.
|
||||||
|
* @param hex - The hex color to expand.
|
||||||
|
* @returns The expanded hex color.
|
||||||
|
* @throws If the hex color is invalid.
|
||||||
|
*/
|
||||||
export const expandHex = (hex: string): string => {
|
export const expandHex = (hex: string): string => {
|
||||||
hex = hex.replace("#", "");
|
const color = parse(hex);
|
||||||
if (hex.length === 6) return hex;
|
if (!color) {
|
||||||
let result = "";
|
throw new Error(`Invalid hex color: ${hex}`);
|
||||||
for (const val of hex) {
|
|
||||||
result += val + val;
|
|
||||||
}
|
}
|
||||||
return result;
|
const formattedColor = formatHex(color);
|
||||||
|
if (!formattedColor) {
|
||||||
|
throw new Error(`Could not format hex color: ${hex}`);
|
||||||
|
}
|
||||||
|
return formattedColor.replace("#", "");
|
||||||
};
|
};
|
||||||
|
|
||||||
// Blend 2 hex colors: c1 is placed over c2, blend is c1's opacity.
|
/**
|
||||||
|
* Blends two hex colors. c1 is placed over c2, blend is c1's opacity.
|
||||||
|
* @param c1 - The first hex color.
|
||||||
|
* @param c2 - The second hex color.
|
||||||
|
* @param blend - The blend percentage (0-100).
|
||||||
|
* @returns The blended hex color.
|
||||||
|
*/
|
||||||
export const hexBlend = (c1: string, c2: string, blend = 50): string => {
|
export const hexBlend = (c1: string, c2: string, blend = 50): string => {
|
||||||
let color = "";
|
|
||||||
c1 = expandHex(c1);
|
c1 = expandHex(c1);
|
||||||
c2 = expandHex(c2);
|
c2 = expandHex(c2);
|
||||||
|
let color = "";
|
||||||
for (let i = 0; i <= 5; i += 2) {
|
for (let i = 0; i <= 5; i += 2) {
|
||||||
const h1 = parseInt(c1.substring(i, i + 2), 16);
|
const h1 = parseInt(c1.substring(i, i + 2), 16);
|
||||||
const h2 = parseInt(c2.substring(i, i + 2), 16);
|
const h2 = parseInt(c2.substring(i, i + 2), 16);
|
||||||
let hex = Math.floor(h2 + (h1 - h2) * (blend / 100)).toString(16);
|
const hex = Math.floor(h2 + (h1 - h2) * (blend / 100))
|
||||||
while (hex.length < 2) hex = "0" + hex;
|
.toString(16)
|
||||||
|
.padStart(2, "0");
|
||||||
color += hex;
|
color += hex;
|
||||||
}
|
}
|
||||||
return `#${color}`;
|
return `#${color}`;
|
||||||
|
@@ -1,28 +1,49 @@
|
|||||||
export const luminosity = (rgb: [number, number, number]): number => {
|
import { wcagLuminance, wcagContrast } from "culori";
|
||||||
// http://www.w3.org/TR/WCAG20/#relativeluminancedef
|
|
||||||
const lum: [number, number, number] = [0, 0, 0];
|
|
||||||
for (let i = 0; i < rgb.length; i++) {
|
|
||||||
const chan = rgb[i] / 255;
|
|
||||||
lum[i] = chan <= 0.03928 ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
|
/**
|
||||||
};
|
* Calculates the luminosity of an RGB color.
|
||||||
|
* @param rgb - The RGB color to calculate the luminosity of.
|
||||||
|
* @returns The luminosity of the color.
|
||||||
|
*/
|
||||||
|
export const luminosity = (rgb: [number, number, number]): number =>
|
||||||
|
wcagLuminance({
|
||||||
|
mode: "rgb",
|
||||||
|
r: rgb[0] / 255,
|
||||||
|
g: rgb[1] / 255,
|
||||||
|
b: rgb[2] / 255,
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculates the contrast ratio between two RGB colors.
|
||||||
|
* @param color1 - The first color to calculate the contrast ratio of.
|
||||||
|
* @param color2 - The second color to calculate the contrast ratio of.
|
||||||
|
* @returns The contrast ratio between the two colors.
|
||||||
|
*/
|
||||||
export const rgbContrast = (
|
export const rgbContrast = (
|
||||||
color1: [number, number, number],
|
color1: [number, number, number],
|
||||||
color2: [number, number, number]
|
color2: [number, number, number]
|
||||||
) => {
|
) =>
|
||||||
const lum1 = luminosity(color1);
|
wcagContrast(
|
||||||
const lum2 = luminosity(color2);
|
{
|
||||||
|
mode: "rgb",
|
||||||
if (lum1 > lum2) {
|
r: color1[0] / 255,
|
||||||
return (lum1 + 0.05) / (lum2 + 0.05);
|
g: color1[1] / 255,
|
||||||
}
|
b: color1[2] / 255,
|
||||||
|
},
|
||||||
return (lum2 + 0.05) / (lum1 + 0.05);
|
{
|
||||||
};
|
mode: "rgb",
|
||||||
|
r: color2[0] / 255,
|
||||||
|
g: color2[1] / 255,
|
||||||
|
b: color2[2] / 255,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculates the contrast ratio between two RGB colors.
|
||||||
|
* @param rgb1 - The first color to calculate the contrast ratio of.
|
||||||
|
* @param rgb2 - The second color to calculate the contrast ratio of.
|
||||||
|
* @returns The contrast ratio between the two colors.
|
||||||
|
*/
|
||||||
export const getRGBContrastRatio = (
|
export const getRGBContrastRatio = (
|
||||||
rgb1: [number, number, number],
|
rgb1: [number, number, number],
|
||||||
rgb2: [number, number, number]
|
rgb2: [number, number, number]
|
||||||
|
@@ -18,6 +18,7 @@ export const FIXED_DOMAIN_STATES = {
|
|||||||
"pending",
|
"pending",
|
||||||
"triggered",
|
"triggered",
|
||||||
],
|
],
|
||||||
|
alert: ["on", "off", "idle"],
|
||||||
assist_satellite: ["idle", "listening", "responding", "processing"],
|
assist_satellite: ["idle", "listening", "responding", "processing"],
|
||||||
automation: ["on", "off"],
|
automation: ["on", "off"],
|
||||||
binary_sensor: ["on", "off"],
|
binary_sensor: ["on", "off"],
|
||||||
|
@@ -40,6 +40,7 @@ const STATE_COLORED_DOMAIN = new Set([
|
|||||||
"vacuum",
|
"vacuum",
|
||||||
"valve",
|
"valve",
|
||||||
"water_heater",
|
"water_heater",
|
||||||
|
"weather",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export const stateColorCss = (stateObj: HassEntity, state?: string) => {
|
export const stateColorCss = (stateObj: HassEntity, state?: string) => {
|
||||||
|
@@ -974,7 +974,7 @@ export class HaChartBase extends LitElement {
|
|||||||
right: 4px;
|
right: 4px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 4px;
|
gap: var(--ha-space-1);
|
||||||
}
|
}
|
||||||
.chart-controls.small {
|
.chart-controls.small {
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -1011,7 +1011,7 @@ export class HaChartBase extends LitElement {
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
}
|
}
|
||||||
.chart-legend li {
|
.chart-legend li {
|
||||||
height: 24px;
|
height: 24px;
|
||||||
|
@@ -6,6 +6,8 @@ import { computeDomain } from "../../common/entity/compute_domain";
|
|||||||
import { stateColorProperties } from "../../common/entity/state_color";
|
import { stateColorProperties } from "../../common/entity/state_color";
|
||||||
import { UNAVAILABLE, UNKNOWN } from "../../data/entity";
|
import { UNAVAILABLE, UNKNOWN } from "../../data/entity";
|
||||||
import { computeCssValue } from "../../resources/css-variables";
|
import { computeCssValue } from "../../resources/css-variables";
|
||||||
|
import { computeStateDomain } from "../../common/entity/compute_state_domain";
|
||||||
|
import { FIXED_DOMAIN_STATES } from "../../common/entity/get_states";
|
||||||
|
|
||||||
const DOMAIN_STATE_SHADES: Record<string, Record<string, number>> = {
|
const DOMAIN_STATE_SHADES: Record<string, Record<string, number>> = {
|
||||||
media_player: {
|
media_player: {
|
||||||
@@ -51,6 +53,28 @@ function computeTimelineStateColor(
|
|||||||
let colorIndex = 0;
|
let colorIndex = 0;
|
||||||
const stateColorMap = new Map<string, string>();
|
const stateColorMap = new Map<string, string>();
|
||||||
|
|
||||||
|
function computeTimelineEnumColor(
|
||||||
|
state: string,
|
||||||
|
computedStyles: CSSStyleDeclaration,
|
||||||
|
stateObj?: HassEntity
|
||||||
|
): string | undefined {
|
||||||
|
if (!stateObj) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
const domain = computeStateDomain(stateObj);
|
||||||
|
const states =
|
||||||
|
FIXED_DOMAIN_STATES[domain] ||
|
||||||
|
(domain === "sensor" &&
|
||||||
|
stateObj.attributes.device_class === "enum" &&
|
||||||
|
stateObj.attributes.options) ||
|
||||||
|
[];
|
||||||
|
const idx = states.indexOf(state);
|
||||||
|
if (idx === -1) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
return getGraphColorByIndex(idx, computedStyles);
|
||||||
|
}
|
||||||
|
|
||||||
function computeTimeLineGenericColor(
|
function computeTimeLineGenericColor(
|
||||||
state: string,
|
state: string,
|
||||||
computedStyles: CSSStyleDeclaration
|
computedStyles: CSSStyleDeclaration
|
||||||
@@ -71,6 +95,7 @@ export function computeTimelineColor(
|
|||||||
): string {
|
): string {
|
||||||
return (
|
return (
|
||||||
computeTimelineStateColor(state, computedStyles, stateObj) ||
|
computeTimelineStateColor(state, computedStyles, stateObj) ||
|
||||||
|
computeTimelineEnumColor(state, computedStyles, stateObj) ||
|
||||||
computeTimeLineGenericColor(state, computedStyles)
|
computeTimeLineGenericColor(state, computedStyles)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -112,7 +112,7 @@ export class HaEntityToggle extends LitElement {
|
|||||||
if (!this.hass || !this.stateObj) {
|
if (!this.hass || !this.stateObj) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
forwardHaptic("light");
|
forwardHaptic(this, "light");
|
||||||
const stateDomain = computeStateDomain(this.stateObj);
|
const stateDomain = computeStateDomain(this.stateObj);
|
||||||
let serviceDomain;
|
let serviceDomain;
|
||||||
let service;
|
let service;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import type { CSSResultGroup, TemplateResult } from "lit";
|
import type { CSSResultGroup, TemplateResult } from "lit";
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement, nothing } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import { fireEvent } from "../common/dom/fire_event";
|
import { fireEvent } from "../common/dom/fire_event";
|
||||||
import type { LocalizeFunc } from "../common/translations/localize";
|
import type { LocalizeFunc } from "../common/translations/localize";
|
||||||
@@ -73,14 +73,18 @@ export class HaAnalytics extends LitElement {
|
|||||||
.checked=${this.analytics?.preferences[preference]}
|
.checked=${this.analytics?.preferences[preference]}
|
||||||
.preference=${preference}
|
.preference=${preference}
|
||||||
name=${preference}
|
name=${preference}
|
||||||
?disabled=${baseEnabled}
|
|
||||||
>
|
>
|
||||||
</ha-switch>
|
</ha-switch>
|
||||||
<ha-tooltip .for="switch-${preference}" placement="right">
|
${baseEnabled
|
||||||
${this.localize(
|
? nothing
|
||||||
`ui.panel.${this.translationKeyPanel}.analytics.need_base_enabled`
|
: html`<ha-tooltip
|
||||||
)}
|
.for="switch-${preference}"
|
||||||
</ha-tooltip>
|
placement="right"
|
||||||
|
>
|
||||||
|
${this.localize(
|
||||||
|
`ui.panel.${this.translationKeyPanel}.analytics.need_base_enabled`
|
||||||
|
)}
|
||||||
|
</ha-tooltip>`}
|
||||||
</span>
|
</span>
|
||||||
</ha-settings-row>
|
</ha-settings-row>
|
||||||
`
|
`
|
||||||
|
@@ -54,7 +54,7 @@ export class HaBadge extends LitElement {
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
height: var(--ha-badge-size, 36px);
|
height: var(--ha-badge-size, 36px);
|
||||||
min-width: var(--ha-badge-size, 36px);
|
min-width: var(--ha-badge-size, 36px);
|
||||||
padding: 0px 12px;
|
padding: 0px 12px;
|
||||||
|
@@ -54,9 +54,9 @@ export class HaBottomSheet extends LitElement {
|
|||||||
border-top-left-radius: var(--ha-border-radius-lg);
|
border-top-left-radius: var(--ha-border-radius-lg);
|
||||||
border-top-right-radius: var(--ha-border-radius-lg);
|
border-top-right-radius: var(--ha-border-radius-lg);
|
||||||
max-height: 90vh;
|
max-height: 90vh;
|
||||||
margin-bottom: var(--safe-area-inset-bottom);
|
padding-bottom: var(--safe-area-inset-bottom);
|
||||||
margin-left: var(--safe-area-inset-left);
|
padding-left: var(--safe-area-inset-left);
|
||||||
margin-right: var(--safe-area-inset-right);
|
padding-right: var(--safe-area-inset-right);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@@ -76,7 +76,7 @@ export class HaCopyTextfield extends LitElement {
|
|||||||
.container {
|
.container {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -343,7 +343,7 @@ export class HaDateRangePicker extends LitElement {
|
|||||||
.date-range-inputs {
|
.date-range-inputs {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.date-range-ranges {
|
.date-range-ranges {
|
||||||
|
@@ -77,8 +77,8 @@ export class HaFormGrid extends LitElement implements HaFormElement {
|
|||||||
var(--form-grid-column-count, auto-fit),
|
var(--form-grid-column-count, auto-fit),
|
||||||
minmax(var(--form-grid-min-width, 200px), 1fr)
|
minmax(var(--form-grid-min-width, 200px), 1fr)
|
||||||
);
|
);
|
||||||
grid-column-gap: 8px;
|
grid-column-gap: var(--ha-space-2);
|
||||||
grid-row-gap: 24px;
|
grid-row-gap: var(--ha-space-6);
|
||||||
}
|
}
|
||||||
:host > ha-form {
|
:host > ha-form {
|
||||||
display: block;
|
display: block;
|
||||||
|
@@ -156,7 +156,7 @@ export class HaFormOptionalActions extends LitElement implements HaFormElement {
|
|||||||
:host {
|
:host {
|
||||||
display: flex !important;
|
display: flex !important;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 24px;
|
gap: var(--ha-space-6);
|
||||||
}
|
}
|
||||||
:host ha-form {
|
:host ha-form {
|
||||||
display: block;
|
display: block;
|
||||||
|
@@ -57,7 +57,7 @@ export class HaFormfield extends FormfieldBase {
|
|||||||
}
|
}
|
||||||
.mdc-form-field {
|
.mdc-form-field {
|
||||||
align-items: var(--ha-formfield-align-items, center);
|
align-items: var(--ha-formfield-align-items, center);
|
||||||
gap: 4px;
|
gap: var(--ha-space-1);
|
||||||
}
|
}
|
||||||
.mdc-form-field > label {
|
.mdc-form-field > label {
|
||||||
direction: var(--direction);
|
direction: var(--direction);
|
||||||
|
@@ -227,7 +227,7 @@ export class HaGridSizeEditor extends LitElement {
|
|||||||
"row-slider preview";
|
"row-slider preview";
|
||||||
grid-template-rows: auto auto;
|
grid-template-rows: auto auto;
|
||||||
grid-template-columns: auto 1fr;
|
grid-template-columns: auto 1fr;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
}
|
}
|
||||||
#columns {
|
#columns {
|
||||||
grid-area: column-slider;
|
grid-area: column-slider;
|
||||||
|
@@ -104,7 +104,7 @@ export class HaIconButtonToolbar extends LitElement {
|
|||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
padding-right: 4px;
|
padding-right: 4px;
|
||||||
height: var(--icon-button-toolbar-height);
|
height: var(--icon-button-toolbar-height);
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-toolbar-button {
|
.icon-toolbar-button {
|
||||||
|
@@ -105,7 +105,7 @@ export class HaPickerField extends LitElement {
|
|||||||
--md-list-item-bottom-space: 0px;
|
--md-list-item-bottom-space: 0px;
|
||||||
--md-list-item-leading-space: 8px;
|
--md-list-item-leading-space: 8px;
|
||||||
--md-list-item-trailing-space: 8px;
|
--md-list-item-trailing-space: 8px;
|
||||||
--ha-md-list-item-gap: 8px;
|
--ha-md-list-item-gap: var(--ha-space-2);
|
||||||
/* Remove the default focus ring */
|
/* Remove the default focus ring */
|
||||||
--md-focus-ring-width: 0px;
|
--md-focus-ring-width: 0px;
|
||||||
--md-focus-ring-duration: 0s;
|
--md-focus-ring-duration: 0s;
|
||||||
|
@@ -39,22 +39,24 @@ class HaSegmentedBar extends LitElement {
|
|||||||
<slot name="extra"></slot>
|
<slot name="extra"></slot>
|
||||||
</div>
|
</div>
|
||||||
<div class="bar">
|
<div class="bar">
|
||||||
${this.segments.map((segment) => {
|
${this.segments.map(
|
||||||
const bar = html`<div
|
(segment, index) => html`
|
||||||
style=${styleMap({
|
${this.hideTooltip || !segment.label
|
||||||
width: `${(segment.value / totalValue) * 100}%`,
|
? nothing
|
||||||
backgroundColor: segment.color,
|
: html`
|
||||||
})}
|
<ha-tooltip for="segment-${index}" placement="top">
|
||||||
></div>`;
|
${segment.label}
|
||||||
return this.hideTooltip && !segment.label
|
</ha-tooltip>
|
||||||
? bar
|
`}
|
||||||
: html`
|
<div
|
||||||
<ha-tooltip>
|
id="segment-${index}"
|
||||||
<span slot="content">${segment.label}</span>
|
style=${styleMap({
|
||||||
${bar}
|
width: `${(segment.value / totalValue) * 100}%`,
|
||||||
</ha-tooltip>
|
backgroundColor: segment.color,
|
||||||
`;
|
})}
|
||||||
})}
|
></div>
|
||||||
|
`
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
${this.hideLegend
|
${this.hideLegend
|
||||||
? nothing
|
? nothing
|
||||||
@@ -88,7 +90,7 @@ class HaSegmentedBar extends LitElement {
|
|||||||
.heading {
|
.heading {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
}
|
}
|
||||||
.heading .title {
|
.heading .title {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@@ -123,7 +125,7 @@ class HaSegmentedBar extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 12px;
|
gap: var(--ha-space-3);
|
||||||
margin: 12px 0;
|
margin: 12px 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
@@ -131,7 +133,7 @@ class HaSegmentedBar extends LitElement {
|
|||||||
.legend li {
|
.legend li {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 4px;
|
gap: var(--ha-space-1);
|
||||||
font-size: var(--ha-font-size-s);
|
font-size: var(--ha-font-size-s);
|
||||||
}
|
}
|
||||||
.legend li .bullet {
|
.legend li .bullet {
|
||||||
|
@@ -116,7 +116,7 @@ export class HaSelectBox extends LitElement {
|
|||||||
.list {
|
.list {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(var(--columns, 1), minmax(0, 1fr));
|
grid-template-columns: repeat(var(--columns, 1), minmax(0, 1fr));
|
||||||
gap: 12px;
|
gap: var(--ha-space-3);
|
||||||
}
|
}
|
||||||
.option {
|
.option {
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -128,7 +128,7 @@ export class HaSelectBox extends LitElement {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
@@ -137,7 +137,7 @@ export class HaSelectBox extends LitElement {
|
|||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
@@ -148,7 +148,7 @@ export class HaSelectBox extends LitElement {
|
|||||||
.option .content .text {
|
.option .content .text {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 4px;
|
gap: var(--ha-space-1);
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
@@ -89,7 +89,7 @@ export class HaButtonToggleSelector extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
@media all and (max-width: 600px) {
|
@media all and (max-width: 600px) {
|
||||||
|
@@ -62,7 +62,7 @@ export class HaColorTempSelector extends LitElement {
|
|||||||
"--ha-slider-background": `linear-gradient( to var(--float-end), ${gradient})`,
|
"--ha-slider-background": `linear-gradient( to var(--float-end), ${gradient})`,
|
||||||
})}
|
})}
|
||||||
labeled
|
labeled
|
||||||
icon="hass:thermometer"
|
icon="mdi:thermometer"
|
||||||
.caption=${this.label || ""}
|
.caption=${this.label || ""}
|
||||||
.min=${min}
|
.min=${min}
|
||||||
.max=${max}
|
.max=${max}
|
||||||
|
@@ -321,7 +321,7 @@ export class HaMediaSelector extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
gap: 12px;
|
gap: var(--ha-space-3);
|
||||||
}
|
}
|
||||||
ha-card .thumbnail {
|
ha-card .thumbnail {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
|
@@ -82,12 +82,12 @@ export class HaNumberSelector extends LitElement {
|
|||||||
labeled
|
labeled
|
||||||
.min=${this.selector.number!.min}
|
.min=${this.selector.number!.min}
|
||||||
.max=${this.selector.number!.max}
|
.max=${this.selector.number!.max}
|
||||||
.value=${this.value ?? ""}
|
.value=${this.value}
|
||||||
.step=${sliderStep}
|
.step=${sliderStep}
|
||||||
.disabled=${this.disabled}
|
.disabled=${this.disabled}
|
||||||
.required=${this.required}
|
.required=${this.required}
|
||||||
@change=${this._handleSliderChange}
|
@change=${this._handleSliderChange}
|
||||||
.ticks=${this.selector.number?.slider_ticks}
|
.withMarkers=${this.selector.number?.slider_ticks || false}
|
||||||
>
|
>
|
||||||
</ha-slider>
|
</ha-slider>
|
||||||
`
|
`
|
||||||
|
@@ -297,7 +297,7 @@ export class HaObjectSelector extends LitElement {
|
|||||||
return [
|
return [
|
||||||
css`
|
css`
|
||||||
ha-md-list {
|
ha-md-list {
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
}
|
}
|
||||||
ha-md-list-item {
|
ha-md-list-item {
|
||||||
border: 1px solid var(--divider-color);
|
border: 1px solid var(--divider-color);
|
||||||
|
@@ -22,6 +22,7 @@ import {
|
|||||||
eventOptions,
|
eventOptions,
|
||||||
property,
|
property,
|
||||||
query,
|
query,
|
||||||
|
queryAll,
|
||||||
state,
|
state,
|
||||||
} from "lit/decorators";
|
} from "lit/decorators";
|
||||||
import { classMap } from "lit/directives/class-map";
|
import { classMap } from "lit/directives/class-map";
|
||||||
@@ -40,7 +41,7 @@ import { updateCanInstall } from "../data/update";
|
|||||||
import { showEditSidebarDialog } from "../dialogs/sidebar/show-dialog-edit-sidebar";
|
import { showEditSidebarDialog } from "../dialogs/sidebar/show-dialog-edit-sidebar";
|
||||||
import { SubscribeMixin } from "../mixins/subscribe-mixin";
|
import { SubscribeMixin } from "../mixins/subscribe-mixin";
|
||||||
import { actionHandler } from "../panels/lovelace/common/directives/action-handler-directive";
|
import { actionHandler } from "../panels/lovelace/common/directives/action-handler-directive";
|
||||||
import { haStyleScrollbar } from "../resources/styles";
|
import { haStyleAnimations, haStyleScrollbar } from "../resources/styles";
|
||||||
import type { HomeAssistant, PanelInfo, Route } from "../types";
|
import type { HomeAssistant, PanelInfo, Route } from "../types";
|
||||||
import "./ha-fade-in";
|
import "./ha-fade-in";
|
||||||
import "./ha-icon";
|
import "./ha-icon";
|
||||||
@@ -210,6 +211,8 @@ class HaSidebar extends SubscribeMixin(LitElement) {
|
|||||||
|
|
||||||
@query(".tooltip") private _tooltip!: HTMLDivElement;
|
@query(".tooltip") private _tooltip!: HTMLDivElement;
|
||||||
|
|
||||||
|
@queryAll("ha-md-list-item") private _listItems!: NodeListOf<HaMdListItem>;
|
||||||
|
|
||||||
public hassSubscribe() {
|
public hassSubscribe() {
|
||||||
return [
|
return [
|
||||||
subscribeFrontendUserData(
|
subscribeFrontendUserData(
|
||||||
@@ -322,6 +325,15 @@ class HaSidebar extends SubscribeMixin(LitElement) {
|
|||||||
if (changedProps.has("alwaysExpand")) {
|
if (changedProps.has("alwaysExpand")) {
|
||||||
toggleAttribute(this, "expanded", this.alwaysExpand);
|
toggleAttribute(this, "expanded", this.alwaysExpand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Staggered animation for list items based on index
|
||||||
|
this._listItems.forEach((item, index) => {
|
||||||
|
(item as HTMLElement).style.setProperty(
|
||||||
|
"--animation-index",
|
||||||
|
String(index + 1)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
if (!changedProps.has("hass")) {
|
if (!changedProps.has("hass")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -693,6 +705,7 @@ class HaSidebar extends SubscribeMixin(LitElement) {
|
|||||||
static get styles(): CSSResultGroup {
|
static get styles(): CSSResultGroup {
|
||||||
return [
|
return [
|
||||||
haStyleScrollbar,
|
haStyleScrollbar,
|
||||||
|
haStyleAnimations,
|
||||||
css`
|
css`
|
||||||
:host {
|
:host {
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
@@ -739,6 +752,14 @@ class HaSidebar extends SubscribeMixin(LitElement) {
|
|||||||
}
|
}
|
||||||
.menu ha-icon-button {
|
.menu ha-icon-button {
|
||||||
color: var(--sidebar-icon-color);
|
color: var(--sidebar-icon-color);
|
||||||
|
animation: fadeInSlideDown var(--ha-animation-duration) ease-out both;
|
||||||
|
animation-delay: var(--ha-animation-delay-base) / 2;
|
||||||
|
}
|
||||||
|
ha-md-list-item {
|
||||||
|
animation: fadeInSlideDown var(--ha-animation-duration) ease-out both;
|
||||||
|
animation-delay: calc(
|
||||||
|
var(--ha-animation-delay-base) * var(--animation-index, 1) / 2
|
||||||
|
);
|
||||||
}
|
}
|
||||||
.title {
|
.title {
|
||||||
margin-left: 3px;
|
margin-left: 3px;
|
||||||
@@ -909,11 +930,6 @@ class HaSidebar extends SubscribeMixin(LitElement) {
|
|||||||
padding: 4px;
|
padding: 4px;
|
||||||
font-weight: var(--ha-font-weight-medium);
|
font-weight: var(--ha-font-weight-medium);
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu ha-icon-button {
|
|
||||||
-webkit-transform: scaleX(var(--scale-direction));
|
|
||||||
transform: scaleX(var(--scale-direction));
|
|
||||||
}
|
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -19,7 +19,7 @@ export class HaSlider extends Slider {
|
|||||||
Slider.styles,
|
Slider.styles,
|
||||||
css`
|
css`
|
||||||
:host {
|
:host {
|
||||||
--wa-form-control-activated-color: var(--primary-color);
|
--wa-form-control-activated-color: var(--ha-control-color);
|
||||||
--track-size: var(--ha-slider-track-size, 4px);
|
--track-size: var(--ha-slider-track-size, 4px);
|
||||||
--marker-height: calc(var(--ha-slider-track-size, 4px) / 2);
|
--marker-height: calc(var(--ha-slider-track-size, 4px) / 2);
|
||||||
--marker-width: calc(var(--ha-slider-track-size, 4px) / 2);
|
--marker-width: calc(var(--ha-slider-track-size, 4px) / 2);
|
||||||
|
@@ -15,7 +15,7 @@ export class HaSwitch extends SwitchBase {
|
|||||||
super.firstUpdated();
|
super.firstUpdated();
|
||||||
this.addEventListener("change", () => {
|
this.addEventListener("change", () => {
|
||||||
if (this.haptic) {
|
if (this.haptic) {
|
||||||
forwardHaptic("light");
|
forwardHaptic(this, "light");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -18,6 +18,8 @@ export class HaTabGroupTab extends Tab {
|
|||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
|
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
|
||||||
|
--wa-space-l: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
:host([active]:not([disabled])) {
|
:host([active]:not([disabled])) {
|
||||||
|
@@ -217,7 +217,7 @@ class DialogJoinMediaPlayers extends LitElement {
|
|||||||
.content {
|
.content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
row-gap: 16px;
|
row-gap: var(--ha-space-4);
|
||||||
}
|
}
|
||||||
|
|
||||||
ha-dialog-header ha-button {
|
ha-dialog-header ha-button {
|
||||||
|
@@ -1138,7 +1138,7 @@ export class HaMediaPlayerBrowse extends LitElement {
|
|||||||
auto-fit,
|
auto-fit,
|
||||||
minmax(var(--media-browse-item-size, 175px), 0.1fr)
|
minmax(var(--media-browse-item-size, 175px), 0.1fr)
|
||||||
);
|
);
|
||||||
grid-gap: 16px;
|
grid-gap: var(--ha-space-4);
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -54,7 +54,7 @@ class HaMediaPlayerToggle extends LitElement {
|
|||||||
.list-item {
|
.list-item {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: auto 1fr auto;
|
grid-template-columns: auto 1fr auto;
|
||||||
column-gap: 16px;
|
column-gap: var(--ha-space-4);
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
@@ -28,6 +28,6 @@ declare global {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const forwardHaptic = (hapticType: HapticType) => {
|
export const forwardHaptic = (node: HTMLElement, hapticType: HapticType) => {
|
||||||
fireEvent(window, "haptic", hapticType);
|
fireEvent(node, "haptic", hapticType);
|
||||||
};
|
};
|
||||||
|
@@ -4,6 +4,7 @@ export interface LovelaceBadgeConfig {
|
|||||||
type: string;
|
type: string;
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
visibility?: Condition[];
|
visibility?: Condition[];
|
||||||
|
disabled?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ensureBadgeConfig = (
|
export const ensureBadgeConfig = (
|
||||||
|
@@ -39,6 +39,8 @@ import type { HomeAssistant, TranslationDict } from "../types";
|
|||||||
import { isUnavailableState } from "./entity";
|
import { isUnavailableState } from "./entity";
|
||||||
import { isTTSMediaSource } from "./tts";
|
import { isTTSMediaSource } from "./tts";
|
||||||
|
|
||||||
|
import { generateEntityFilter } from "../common/entity/entity_filter";
|
||||||
|
|
||||||
interface MediaPlayerEntityAttributes extends HassEntityAttributeBase {
|
interface MediaPlayerEntityAttributes extends HassEntityAttributeBase {
|
||||||
media_content_id?: string;
|
media_content_id?: string;
|
||||||
media_content_type?: string;
|
media_content_type?: string;
|
||||||
@@ -522,3 +524,33 @@ export const mediaPlayerJoin = (
|
|||||||
|
|
||||||
export const mediaPlayerUnjoin = (hass: HomeAssistant, entity_id: string) =>
|
export const mediaPlayerUnjoin = (hass: HomeAssistant, entity_id: string) =>
|
||||||
hass.callService("media_player", "unjoin", {}, { entity_id });
|
hass.callService("media_player", "unjoin", {}, { entity_id });
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compute active media player states in a specific area.
|
||||||
|
* @param hass Home Assistant object
|
||||||
|
* @param areaId Area ID to filter media players by
|
||||||
|
* @returns Array of playing media player entities
|
||||||
|
*/
|
||||||
|
export const computeActiveAreaMediaStates = (
|
||||||
|
hass: HomeAssistant,
|
||||||
|
areaId: string
|
||||||
|
): MediaPlayerEntity[] => {
|
||||||
|
const area = hass.areas[areaId];
|
||||||
|
if (!area) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get all media_player entities in this area
|
||||||
|
const mediaFilter = generateEntityFilter(hass, {
|
||||||
|
area: areaId,
|
||||||
|
domain: "media_player",
|
||||||
|
});
|
||||||
|
|
||||||
|
const mediaEntities = Object.keys(hass.entities).filter(mediaFilter);
|
||||||
|
|
||||||
|
return mediaEntities
|
||||||
|
.map((entityId) => hass.states[entityId] as MediaPlayerEntity | undefined)
|
||||||
|
.filter(
|
||||||
|
(stateObj): stateObj is MediaPlayerEntity => stateObj?.state === "playing"
|
||||||
|
);
|
||||||
|
};
|
||||||
|
@@ -66,9 +66,9 @@ export const getPanelIcon = (panel: PanelInfo): string | null => {
|
|||||||
if (!panel.icon) {
|
if (!panel.icon) {
|
||||||
switch (panel.component_name) {
|
switch (panel.component_name) {
|
||||||
case "profile":
|
case "profile":
|
||||||
return "hass:account";
|
return "mdi:account";
|
||||||
case "lovelace":
|
case "lovelace":
|
||||||
return "hass:view-dashboard";
|
return "mdi:view-dashboard";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@ import type { Action } from "./script";
|
|||||||
export const callExecuteScript = (
|
export const callExecuteScript = (
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
sequence: Action | Action[]
|
sequence: Action | Action[]
|
||||||
): Promise<{ context: Context; response: Record<string, any> }> =>
|
): Promise<{ context: Context; response: Record<string, any> | null }> =>
|
||||||
hass.callWS({
|
hass.callWS({
|
||||||
type: "execute_script",
|
type: "execute_script",
|
||||||
sequence,
|
sequence,
|
||||||
|
@@ -325,7 +325,7 @@ class StepFlowCreateEntry extends LitElement {
|
|||||||
.device-info {
|
.device-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
}
|
}
|
||||||
.device-info img {
|
.device-info img {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
|
@@ -26,20 +26,21 @@ class StepFlowLoading extends LitElement {
|
|||||||
this.step
|
this.step
|
||||||
);
|
);
|
||||||
return html`
|
return html`
|
||||||
<div class="init-spinner">
|
<div class="content">
|
||||||
|
<ha-spinner size="large"></ha-spinner>
|
||||||
${description ? html`<div>${description}</div>` : ""}
|
${description ? html`<div>${description}</div>` : ""}
|
||||||
<ha-spinner></ha-spinner>
|
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static styles = css`
|
static styles = css`
|
||||||
.init-spinner {
|
.content {
|
||||||
|
margin-top: 0;
|
||||||
padding: 50px 100px;
|
padding: 50px 100px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
ha-spinner {
|
ha-spinner {
|
||||||
margin-top: 16px;
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@@ -34,7 +34,7 @@ class StepFlowProgress extends LitElement {
|
|||||||
)}%</ha-progress-ring
|
)}%</ha-progress-ring
|
||||||
>
|
>
|
||||||
`
|
`
|
||||||
: html` <ha-spinner size="large"></ha-spinner> `}
|
: html`<ha-spinner size="large"></ha-spinner>`}
|
||||||
${this.flowConfig.renderShowFormProgressDescription(
|
${this.flowConfig.renderShowFormProgressDescription(
|
||||||
this.hass,
|
this.hass,
|
||||||
this.step
|
this.step
|
||||||
@@ -48,6 +48,7 @@ class StepFlowProgress extends LitElement {
|
|||||||
configFlowContentStyles,
|
configFlowContentStyles,
|
||||||
css`
|
css`
|
||||||
.content {
|
.content {
|
||||||
|
margin-top: 0;
|
||||||
padding: 50px 100px;
|
padding: 50px 100px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
@@ -209,7 +209,7 @@ export class DialogEnterCode
|
|||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(var(--keypad-columns), auto);
|
grid-template-columns: repeat(var(--keypad-columns), auto);
|
||||||
grid-auto-rows: auto;
|
grid-auto-rows: auto;
|
||||||
grid-gap: 24px;
|
grid-gap: var(--ha-space-6);
|
||||||
justify-items: center;
|
justify-items: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
@@ -32,7 +32,7 @@ export class HaMoreInfoControlSelectContainer extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
gap: 12px;
|
gap: var(--ha-space-3);
|
||||||
margin: auto;
|
margin: auto;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
-ms-overflow-style: none; /* IE and Edge */
|
-ms-overflow-style: none; /* IE and Edge */
|
||||||
|
@@ -110,7 +110,7 @@ class LightRgbColorPicker extends LitElement {
|
|||||||
? html`<ha-labeled-slider
|
? html`<ha-labeled-slider
|
||||||
labeled
|
labeled
|
||||||
.caption=${this.hass.localize("ui.card.light.color_brightness")}
|
.caption=${this.hass.localize("ui.card.light.color_brightness")}
|
||||||
icon="hass:brightness-7"
|
icon="mdi:brightness-7"
|
||||||
min="0"
|
min="0"
|
||||||
max="100"
|
max="100"
|
||||||
.value=${this._colorBrightnessSliderValue}
|
.value=${this._colorBrightnessSliderValue}
|
||||||
@@ -122,7 +122,7 @@ class LightRgbColorPicker extends LitElement {
|
|||||||
<ha-labeled-slider
|
<ha-labeled-slider
|
||||||
labeled
|
labeled
|
||||||
.caption=${this.hass.localize("ui.card.light.white_value")}
|
.caption=${this.hass.localize("ui.card.light.white_value")}
|
||||||
icon="hass:file-word-box"
|
icon="mdi:file-word-box"
|
||||||
min="0"
|
min="0"
|
||||||
max="100"
|
max="100"
|
||||||
.name=${"wv"}
|
.name=${"wv"}
|
||||||
@@ -136,7 +136,7 @@ class LightRgbColorPicker extends LitElement {
|
|||||||
<ha-labeled-slider
|
<ha-labeled-slider
|
||||||
labeled
|
labeled
|
||||||
.caption=${this.hass.localize("ui.card.light.cold_white_value")}
|
.caption=${this.hass.localize("ui.card.light.cold_white_value")}
|
||||||
icon="hass:file-word-box-outline"
|
icon="mdi:file-word-box-outline"
|
||||||
min="0"
|
min="0"
|
||||||
max="100"
|
max="100"
|
||||||
.name=${"cw"}
|
.name=${"cw"}
|
||||||
@@ -146,7 +146,7 @@ class LightRgbColorPicker extends LitElement {
|
|||||||
<ha-labeled-slider
|
<ha-labeled-slider
|
||||||
labeled
|
labeled
|
||||||
.caption=${this.hass.localize("ui.card.light.warm_white_value")}
|
.caption=${this.hass.localize("ui.card.light.warm_white_value")}
|
||||||
icon="hass:file-word-box"
|
icon="mdi:file-word-box"
|
||||||
min="0"
|
min="0"
|
||||||
max="100"
|
max="100"
|
||||||
.name=${"ww"}
|
.name=${"ww"}
|
||||||
|
@@ -202,13 +202,13 @@ class MoreInfoSirenAdvancedControls extends LitElement {
|
|||||||
.options {
|
.options {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 16px;
|
gap: var(--ha-space-4);
|
||||||
}
|
}
|
||||||
.controls {
|
.controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 16px;
|
gap: var(--ha-space-4);
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
}
|
}
|
||||||
ha-control-button {
|
ha-control-button {
|
||||||
|
@@ -107,7 +107,7 @@ class MoreInfoCamera extends LitElement {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@@ -42,7 +42,7 @@ class MoreInfoFan extends LitElement {
|
|||||||
|
|
||||||
private _toggle = () => {
|
private _toggle = () => {
|
||||||
const service = this.stateObj?.state === "on" ? "turn_off" : "turn_on";
|
const service = this.stateObj?.state === "on" ? "turn_off" : "turn_on";
|
||||||
forwardHaptic("light");
|
forwardHaptic(this, "light");
|
||||||
this.hass.callService("fan", service, {
|
this.hass.callService("fan", service, {
|
||||||
entity_id: this.stateObj!.entity_id,
|
entity_id: this.stateObj!.entity_id,
|
||||||
});
|
});
|
||||||
|
@@ -310,7 +310,7 @@ class MoreInfoLight extends LitElement {
|
|||||||
|
|
||||||
private _toggle = () => {
|
private _toggle = () => {
|
||||||
const service = this.stateObj?.state === "on" ? "turn_off" : "turn_on";
|
const service = this.stateObj?.state === "on" ? "turn_off" : "turn_on";
|
||||||
forwardHaptic("light");
|
forwardHaptic(this, "light");
|
||||||
this.hass.callService("light", service, {
|
this.hass.callService("light", service, {
|
||||||
entity_id: this.stateObj!.entity_id,
|
entity_id: this.stateObj!.entity_id,
|
||||||
});
|
});
|
||||||
|
@@ -181,7 +181,7 @@ class MoreInfoLock extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
font-weight: var(--ha-font-weight-medium);
|
font-weight: var(--ha-font-weight-medium);
|
||||||
color: var(--success-color);
|
color: var(--success-color);
|
||||||
}
|
}
|
||||||
|
@@ -48,10 +48,10 @@ class MoreInfoMediaPlayer extends LitElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public stateObj?: MediaPlayerEntity;
|
@property({ attribute: false }) public stateObj?: MediaPlayerEntity;
|
||||||
|
|
||||||
private _formateDuration(duration: number) {
|
private _formatDuration(duration: number) {
|
||||||
const hours = Math.floor(duration / 3600);
|
const hours = Math.floor(duration / 3600);
|
||||||
const minutes = Math.floor((duration % 3600) / 60);
|
const minutes = Math.floor((duration % 3600) / 60);
|
||||||
const seconds = duration % 60;
|
const seconds = Math.floor(duration % 60);
|
||||||
return formatDurationDigital(this.hass.locale, {
|
return formatDurationDigital(this.hass.locale, {
|
||||||
hours,
|
hours,
|
||||||
minutes,
|
minutes,
|
||||||
@@ -258,14 +258,17 @@ class MoreInfoMediaPlayer extends LitElement {
|
|||||||
|
|
||||||
const stateObj = this.stateObj;
|
const stateObj = this.stateObj;
|
||||||
const controls = computeMediaControls(stateObj, true);
|
const controls = computeMediaControls(stateObj, true);
|
||||||
const coverUrl = stateObj.attributes.entity_picture || "";
|
const coverUrl =
|
||||||
|
stateObj.attributes.entity_picture_local ||
|
||||||
|
stateObj.attributes.entity_picture ||
|
||||||
|
"";
|
||||||
const playerObj = new HassMediaPlayerEntity(this.hass, this.stateObj);
|
const playerObj = new HassMediaPlayerEntity(this.hass, this.stateObj);
|
||||||
const position = Math.floor(playerObj.currentProgress) || 0;
|
|
||||||
const duration = stateObj.attributes.media_duration || 0;
|
const position = Math.max(Math.floor(playerObj.currentProgress || 0), 0);
|
||||||
const remaining = duration - position;
|
const duration = Math.max(stateObj.attributes.media_duration || 0, 0);
|
||||||
const durationFormated =
|
const remaining = Math.max(duration - position, 0);
|
||||||
remaining > 0 ? this._formateDuration(remaining) : 0;
|
const remainingFormatted = this._formatDuration(remaining);
|
||||||
const postionFormated = this._formateDuration(position);
|
const positionFormatted = this._formatDuration(position);
|
||||||
const primaryTitle = playerObj.primaryTitle;
|
const primaryTitle = playerObj.primaryTitle;
|
||||||
const secondaryTitle = playerObj.secondaryTitle;
|
const secondaryTitle = playerObj.secondaryTitle;
|
||||||
const turnOn = controls?.find((c) => c.action === "turn_on");
|
const turnOn = controls?.find((c) => c.action === "turn_on");
|
||||||
@@ -323,11 +326,10 @@ class MoreInfoMediaPlayer extends LitElement {
|
|||||||
@change=${this._handleMediaSeekChanged}
|
@change=${this._handleMediaSeekChanged}
|
||||||
?disabled=${!stateActive(stateObj) ||
|
?disabled=${!stateActive(stateObj) ||
|
||||||
!supportsFeature(stateObj, MediaPlayerEntityFeature.SEEK)}
|
!supportsFeature(stateObj, MediaPlayerEntityFeature.SEEK)}
|
||||||
></ha-slider>
|
>
|
||||||
<div class="position-info-row">
|
<span slot="reference">${positionFormatted}</span>
|
||||||
<span class="position-time">${postionFormated}</span>
|
<span slot="reference">${remainingFormatted}</span>
|
||||||
<span class="duration-time">${durationFormated}</span>
|
</ha-slider>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: nothing}
|
: nothing}
|
||||||
@@ -443,7 +445,7 @@ class MoreInfoMediaPlayer extends LitElement {
|
|||||||
:host {
|
:host {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 24px;
|
gap: var(--ha-space-6);
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -477,6 +479,22 @@ class MoreInfoMediaPlayer extends LitElement {
|
|||||||
height: 320px;
|
height: 320px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-height: 750px) {
|
||||||
|
.cover-container {
|
||||||
|
height: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cover-image {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cover-image--playing {
|
||||||
|
width: 120px;
|
||||||
|
height: 120px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.empty-cover {
|
.empty-cover {
|
||||||
background-color: var(--secondary-background-color);
|
background-color: var(--secondary-background-color);
|
||||||
font-size: 1.5em;
|
font-size: 1.5em;
|
||||||
@@ -511,7 +529,7 @@ class MoreInfoMediaPlayer extends LitElement {
|
|||||||
.volume {
|
.volume {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: var(--ha-space-3);
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -548,13 +566,8 @@ class MoreInfoMediaPlayer extends LitElement {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.position-info-row {
|
.position-bar ha-slider::part(references) {
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: space-between;
|
|
||||||
color: var(--secondary-text-color);
|
color: var(--secondary-text-color);
|
||||||
padding: 0 8px;
|
|
||||||
font-size: var(--ha-font-size-s);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.media-info-row {
|
.media-info-row {
|
||||||
@@ -597,7 +610,7 @@ class MoreInfoMediaPlayer extends LitElement {
|
|||||||
.bottom-controls {
|
.bottom-controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 24px;
|
gap: var(--ha-space-6);
|
||||||
align-self: center;
|
align-self: center;
|
||||||
width: 320px;
|
width: 320px;
|
||||||
}
|
}
|
||||||
|
@@ -508,7 +508,7 @@ class MoreInfoUpdate extends LitElement {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
|
@@ -269,7 +269,7 @@ class DialogShortcuts extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
margin: 4px 0;
|
margin: 4px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,6 +8,7 @@ import { createCloseHeading } from "../../components/ha-dialog";
|
|||||||
import "../../components/ha-textarea";
|
import "../../components/ha-textarea";
|
||||||
import type { HaTextArea } from "../../components/ha-textarea";
|
import type { HaTextArea } from "../../components/ha-textarea";
|
||||||
import { convertTextToSpeech } from "../../data/tts";
|
import { convertTextToSpeech } from "../../data/tts";
|
||||||
|
import { haStyleDialog } from "../../resources/styles";
|
||||||
import type { HomeAssistant } from "../../types";
|
import type { HomeAssistant } from "../../types";
|
||||||
import { showAlertDialog } from "../generic/show-dialog-box";
|
import { showAlertDialog } from "../generic/show-dialog-box";
|
||||||
import type { TTSTryDialogParams } from "./show-dialog-tts-try";
|
import type { TTSTryDialogParams } from "./show-dialog-tts-try";
|
||||||
@@ -149,21 +150,24 @@ export class TTSTryDialog extends LitElement {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static styles = css`
|
static styles = [
|
||||||
ha-dialog {
|
haStyleDialog,
|
||||||
--mdc-dialog-max-width: 500px;
|
css`
|
||||||
}
|
ha-dialog {
|
||||||
ha-textarea,
|
--mdc-dialog-max-width: 500px;
|
||||||
ha-select {
|
}
|
||||||
width: 100%;
|
ha-textarea,
|
||||||
}
|
ha-select {
|
||||||
ha-select {
|
width: 100%;
|
||||||
margin-top: 8px;
|
}
|
||||||
}
|
ha-select {
|
||||||
.loading {
|
margin-top: 8px;
|
||||||
height: 36px;
|
}
|
||||||
}
|
.loading {
|
||||||
`;
|
height: 36px;
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
@@ -127,7 +127,7 @@ export class CloudStepIntro extends LitElement {
|
|||||||
.features {
|
.features {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
grid-gap: 16px;
|
grid-gap: var(--ha-space-4);
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
}
|
}
|
||||||
.feature {
|
.feature {
|
||||||
|
@@ -427,7 +427,7 @@ export class HaVoiceAssistantSetupStepPipeline extends LitElement {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 10px;
|
height: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 4px;
|
gap: var(--ha-space-1);
|
||||||
margin: 8px 0;
|
margin: 8px 0;
|
||||||
}
|
}
|
||||||
.segment {
|
.segment {
|
||||||
|
@@ -368,7 +368,7 @@ export class HaVoiceAssistantSetupStepSuccess extends LitElement {
|
|||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
}
|
}
|
||||||
.rows {
|
.rows {
|
||||||
gap: 16px;
|
gap: var(--ha-space-4);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
@@ -60,28 +60,28 @@ export const demoPanels: Panels = {
|
|||||||
// Uncomment when we are ready to stub the history API
|
// Uncomment when we are ready to stub the history API
|
||||||
// history: {
|
// history: {
|
||||||
// component_name: "history",
|
// component_name: "history",
|
||||||
// icon: "hass:poll-box",
|
// icon: "mdi:chart-box",
|
||||||
// title: "history",
|
// title: "history",
|
||||||
// config: null,
|
// config: null,
|
||||||
// url_path: "history",
|
// url_path: "history",
|
||||||
// },
|
// },
|
||||||
map: {
|
map: {
|
||||||
component_name: "lovelace",
|
component_name: "lovelace",
|
||||||
icon: "hass:tooltip-account",
|
icon: "mdi:tooltip-account",
|
||||||
title: "map",
|
title: "map",
|
||||||
config: { mode: "storage" },
|
config: { mode: "storage" },
|
||||||
url_path: "map",
|
url_path: "map",
|
||||||
},
|
},
|
||||||
energy: {
|
energy: {
|
||||||
component_name: "energy",
|
component_name: "energy",
|
||||||
icon: "hass:lightning-bolt",
|
icon: "mdi:lightning-bolt",
|
||||||
title: "energy",
|
title: "energy",
|
||||||
config: null,
|
config: null,
|
||||||
url_path: "energy",
|
url_path: "energy",
|
||||||
},
|
},
|
||||||
// config: {
|
// config: {
|
||||||
// component_name: "config",
|
// component_name: "config",
|
||||||
// icon: "hass:cog",
|
// icon: "mdi:cog",
|
||||||
// title: "config",
|
// title: "config",
|
||||||
// config: null,
|
// config: null,
|
||||||
// url_path: "config",
|
// url_path: "config",
|
||||||
|
@@ -182,7 +182,7 @@ class HassSubpage extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
}
|
}
|
||||||
:host([narrow]) #fab.tabs {
|
:host([narrow]) #fab.tabs {
|
||||||
bottom: calc(84px + var(--safe-area-inset-bottom, 0px));
|
bottom: calc(84px + var(--safe-area-inset-bottom, 0px));
|
||||||
|
@@ -740,7 +740,7 @@ export class HaTabsSubpageDataTable extends KeyboardShortcutMixin(LitElement) {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 0 16px;
|
padding: 0 16px;
|
||||||
gap: 16px;
|
gap: var(--ha-space-4);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background: var(--primary-background-color);
|
background: var(--primary-background-color);
|
||||||
border-bottom: 1px solid var(--divider-color);
|
border-bottom: 1px solid var(--divider-color);
|
||||||
@@ -823,7 +823,7 @@ export class HaTabsSubpageDataTable extends KeyboardShortcutMixin(LitElement) {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
min-width: 100%;
|
min-width: 100%;
|
||||||
gap: 16px;
|
gap: var(--ha-space-4);
|
||||||
padding: 0 16px;
|
padding: 0 16px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow-x: scroll;
|
overflow-x: scroll;
|
||||||
@@ -852,7 +852,7 @@ export class HaTabsSubpageDataTable extends KeyboardShortcutMixin(LitElement) {
|
|||||||
.selection-controls {
|
.selection-controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.selection-controls p {
|
.selection-controls p {
|
||||||
@@ -864,7 +864,7 @@ export class HaTabsSubpageDataTable extends KeyboardShortcutMixin(LitElement) {
|
|||||||
.center-vertical {
|
.center-vertical {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.relative {
|
.relative {
|
||||||
|
@@ -362,7 +362,7 @@ class HassTabsSubpage extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
}
|
}
|
||||||
:host([narrow]) #fab.tabs {
|
:host([narrow]) #fab.tabs {
|
||||||
bottom: calc(84px + var(--safe-area-inset-bottom, 0px));
|
bottom: calc(84px + var(--safe-area-inset-bottom, 0px));
|
||||||
|
@@ -212,7 +212,7 @@ class OnboardingIntegrations extends SubscribeMixin(LitElement) {
|
|||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(106px, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(106px, 1fr));
|
||||||
row-gap: 24px;
|
row-gap: var(--ha-space-6);
|
||||||
}
|
}
|
||||||
.more {
|
.more {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@@ -64,8 +64,8 @@ class OnboardingWelcomeLinks extends LitElement {
|
|||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
column-gap: 16px;
|
column-gap: var(--ha-space-4);
|
||||||
row-gap: 16px;
|
row-gap: var(--ha-space-4);
|
||||||
}
|
}
|
||||||
@media (max-width: 550px) {
|
@media (max-width: 550px) {
|
||||||
:host {
|
:host {
|
||||||
|
@@ -123,7 +123,7 @@ class OnboardingRestoreBackupCloudLogin extends LitElement {
|
|||||||
font-size: var(--ha-font-size-2xl);
|
font-size: var(--ha-font-size-2xl);
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 16px;
|
gap: var(--ha-space-4);
|
||||||
}
|
}
|
||||||
h2 img {
|
h2 img {
|
||||||
width: 48px;
|
width: 48px;
|
||||||
|
@@ -332,7 +332,7 @@ class OnboardingRestoreBackupRestore extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
line-height: var(--ha-line-height-condensed);
|
line-height: var(--ha-line-height-condensed);
|
||||||
}
|
}
|
||||||
h2 {
|
h2 {
|
||||||
|
@@ -736,7 +736,7 @@ class DialogAddAutomationElement
|
|||||||
}
|
}
|
||||||
.shortcut-label {
|
.shortcut-label {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 12px;
|
gap: var(--ha-space-3);
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
.shortcut-label .supporting-text {
|
.shortcut-label .supporting-text {
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import { consume } from "@lit/context";
|
import { consume } from "@lit/context";
|
||||||
import {
|
import {
|
||||||
|
mdiAppleKeyboardCommand,
|
||||||
mdiCog,
|
mdiCog,
|
||||||
mdiContentSave,
|
mdiContentSave,
|
||||||
mdiDebugStepOver,
|
mdiDebugStepOver,
|
||||||
@@ -87,6 +88,7 @@ import "./blueprint-automation-editor";
|
|||||||
import "./manual-automation-editor";
|
import "./manual-automation-editor";
|
||||||
import type { HaManualAutomationEditor } from "./manual-automation-editor";
|
import type { HaManualAutomationEditor } from "./manual-automation-editor";
|
||||||
import { UndoRedoMixin } from "../../../mixins/undo-redo-mixin";
|
import { UndoRedoMixin } from "../../../mixins/undo-redo-mixin";
|
||||||
|
import { isMac } from "../../../util/is_mac";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface HTMLElementTagNameMap {
|
interface HTMLElementTagNameMap {
|
||||||
@@ -215,6 +217,10 @@ export class HaAutomationEditor extends UndoRedoMixin<
|
|||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
const useBlueprint = "use_blueprint" in this._config;
|
const useBlueprint = "use_blueprint" in this._config;
|
||||||
|
const shortcutIcon = isMac
|
||||||
|
? html`<ha-svg-icon .path=${mdiAppleKeyboardCommand}></ha-svg-icon>`
|
||||||
|
: this.hass.localize("ui.panel.config.automation.editor.ctrl");
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<hass-subpage
|
<hass-subpage
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
@@ -231,16 +237,35 @@ export class HaAutomationEditor extends UndoRedoMixin<
|
|||||||
.path=${mdiUndo}
|
.path=${mdiUndo}
|
||||||
@click=${this.undo}
|
@click=${this.undo}
|
||||||
.disabled=${!this.canUndo}
|
.disabled=${!this.canUndo}
|
||||||
|
id="button-undo"
|
||||||
>
|
>
|
||||||
</ha-icon-button>
|
</ha-icon-button>
|
||||||
|
<ha-tooltip placement="bottom" for="button-undo">
|
||||||
|
${this.hass.localize("ui.common.undo")}
|
||||||
|
<span class="shortcut"
|
||||||
|
>(
|
||||||
|
<span>${shortcutIcon}</span>
|
||||||
|
<span>+</span>
|
||||||
|
<span>Z</span>)
|
||||||
|
</span>
|
||||||
|
</ha-tooltip>
|
||||||
<ha-icon-button
|
<ha-icon-button
|
||||||
slot="toolbar-icon"
|
slot="toolbar-icon"
|
||||||
.label=${this.hass.localize("ui.common.redo")}
|
.label=${this.hass.localize("ui.common.redo")}
|
||||||
.path=${mdiRedo}
|
.path=${mdiRedo}
|
||||||
@click=${this.redo}
|
@click=${this.redo}
|
||||||
.disabled=${!this.canRedo}
|
.disabled=${!this.canRedo}
|
||||||
|
id="button-redo"
|
||||||
>
|
>
|
||||||
</ha-icon-button>`
|
</ha-icon-button>
|
||||||
|
<ha-tooltip placement="bottom" for="button-redo">
|
||||||
|
${this.hass.localize("ui.common.redo")}
|
||||||
|
<span class="shortcut">
|
||||||
|
(<span>${shortcutIcon}</span>
|
||||||
|
<span>+</span>
|
||||||
|
<span>Y</span>)
|
||||||
|
</span>
|
||||||
|
</ha-tooltip>`
|
||||||
: nothing}
|
: nothing}
|
||||||
${this._config?.id && !this.narrow
|
${this._config?.id && !this.narrow
|
||||||
? html`
|
? html`
|
||||||
@@ -1292,6 +1317,15 @@ export class HaAutomationEditor extends UndoRedoMixin<
|
|||||||
ha-fab.dirty {
|
ha-fab.dirty {
|
||||||
bottom: calc(16px + var(--safe-area-inset-bottom, 0px));
|
bottom: calc(16px + var(--safe-area-inset-bottom, 0px));
|
||||||
}
|
}
|
||||||
|
ha-tooltip ha-svg-icon {
|
||||||
|
width: 12px;
|
||||||
|
}
|
||||||
|
ha-tooltip .shortcut {
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
gap: 2px;
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -171,7 +171,7 @@ export default class HaAutomationSidebar extends LitElement {
|
|||||||
@mousedown=${this._handleMouseDown}
|
@mousedown=${this._handleMouseDown}
|
||||||
@touchstart=${this._handleMouseDown}
|
@touchstart=${this._handleMouseDown}
|
||||||
>
|
>
|
||||||
${this._resizing ? html`<div class="indicator"></div>` : nothing}
|
<div class="indicator ${this._resizing ? "" : "hidden"}"></div>
|
||||||
</div>
|
</div>
|
||||||
${this._renderContent()}
|
${this._renderContent()}
|
||||||
`;
|
`;
|
||||||
@@ -333,6 +333,15 @@ export default class HaAutomationSidebar extends LitElement {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
width: 4px;
|
width: 4px;
|
||||||
border-radius: var(--ha-border-radius-pill);
|
border-radius: var(--ha-border-radius-pill);
|
||||||
|
transform: scale3d(1, 1, 1);
|
||||||
|
opacity: 1;
|
||||||
|
transition:
|
||||||
|
transform 180ms ease-in-out,
|
||||||
|
opacity 180ms ease-in-out;
|
||||||
|
}
|
||||||
|
.handle .indicator.hidden {
|
||||||
|
transform: scale3d(0, 1, 1);
|
||||||
|
opacity: 0;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@@ -92,7 +92,7 @@ class DialogPasteReplace extends LitElement implements HassDialog {
|
|||||||
}
|
}
|
||||||
div[slot="primaryAction"] {
|
div[slot="primaryAction"] {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
|
@@ -118,7 +118,7 @@ export const manualEditorStyles = css`
|
|||||||
var(--ha-automation-editor-max-width) -
|
var(--ha-automation-editor-max-width) -
|
||||||
${CONTENT_MIN_WIDTH}px - var(--mdc-drawer-width, 0px)
|
${CONTENT_MIN_WIDTH}px - var(--mdc-drawer-width, 0px)
|
||||||
);
|
);
|
||||||
--sidebar-gap: 16px;
|
--sidebar-gap: var(--ha-space-4);
|
||||||
}
|
}
|
||||||
|
|
||||||
.fab-positioner {
|
.fab-positioner {
|
||||||
@@ -188,7 +188,7 @@ export const automationRowsStyles = css`
|
|||||||
.rows {
|
.rows {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 16px;
|
gap: var(--ha-space-4);
|
||||||
}
|
}
|
||||||
.rows.no-sidebar {
|
.rows.no-sidebar {
|
||||||
margin-inline-end: 0;
|
margin-inline-end: 0;
|
||||||
@@ -225,7 +225,7 @@ export const automationRowsStyles = css`
|
|||||||
.buttons {
|
.buttons {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
order: 1;
|
order: 1;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
@@ -244,7 +244,7 @@ export const overflowStyles = css`
|
|||||||
.overflow-label {
|
.overflow-label {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
gap: 12px;
|
gap: var(--ha-space-3);
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.overflow-label .shortcut {
|
.overflow-label .shortcut {
|
||||||
|
@@ -806,7 +806,7 @@ export default class HaAutomationTriggerRow extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 4px;
|
gap: var(--ha-space-1);
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
@@ -313,13 +313,13 @@ class HaBackupConfigAgents extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
line-height: var(--ha-line-height-condensed);
|
line-height: var(--ha-line-height-condensed);
|
||||||
}
|
}
|
||||||
.unencrypted-warning {
|
.unencrypted-warning {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 4px;
|
gap: var(--ha-space-1);
|
||||||
}
|
}
|
||||||
.dot {
|
.dot {
|
||||||
display: block;
|
display: block;
|
||||||
@@ -341,7 +341,7 @@ class HaBackupConfigAgents extends LitElement {
|
|||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
gap: 4px;
|
gap: var(--ha-space-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
@@ -119,7 +119,7 @@ class HaBackupAgentsPicker extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 16px;
|
gap: var(--ha-space-4);
|
||||||
font-size: var(--ha-font-size-l);
|
font-size: var(--ha-font-size-l);
|
||||||
font-weight: var(--ha-font-weight-normal);
|
font-weight: var(--ha-font-weight-normal);
|
||||||
line-height: var(--ha-line-height-normal);
|
line-height: var(--ha-line-height-normal);
|
||||||
|
@@ -110,7 +110,7 @@ class HaBackupDetailsRestore extends LitElement {
|
|||||||
max-width: 690px;
|
max-width: 690px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
gap: 24px;
|
gap: var(--ha-space-6);
|
||||||
display: grid;
|
display: grid;
|
||||||
}
|
}
|
||||||
.card-content {
|
.card-content {
|
||||||
@@ -133,7 +133,7 @@ class HaBackupDetailsRestore extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
line-height: var(--ha-line-height-condensed);
|
line-height: var(--ha-line-height-condensed);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
@@ -138,7 +138,7 @@ class HaBackupDetailsSummary extends LitElement {
|
|||||||
max-width: 690px;
|
max-width: 690px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
gap: 24px;
|
gap: var(--ha-space-6);
|
||||||
display: grid;
|
display: grid;
|
||||||
}
|
}
|
||||||
.card-content {
|
.card-content {
|
||||||
@@ -168,7 +168,7 @@ class HaBackupDetailsSummary extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: 8px;
|
gap: var(--ha-space-2);
|
||||||
line-height: var(--ha-line-height-condensed);
|
line-height: var(--ha-line-height-condensed);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
@@ -35,7 +35,7 @@ class SupervisorFormfieldLabel extends LitElement {
|
|||||||
:host {
|
:host {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: 16px;
|
gap: var(--ha-space-4);
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.label {
|
.label {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user