mirror of
https://github.com/home-assistant/frontend.git
synced 2026-11-26 22:59:34 +00:00
Compare commits
15
Commits
dev
..
20261125.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c70897226 | ||
|
|
3a27de8e0a | ||
|
|
bc21f2903d | ||
|
|
b067ce5515 | ||
|
|
c95ed9f16c | ||
|
|
95eb2641e2 | ||
|
|
4cb23b772a | ||
|
|
0bf5da2e09 | ||
|
|
c12ad32797 | ||
|
|
2c03c2d74a | ||
|
|
2705e6da51 | ||
|
|
e3871d47de | ||
|
|
ead8c01926 | ||
|
|
258cb6f8b9 | ||
|
|
72057cf504 |
No files matched your search
@@ -1,43 +0,0 @@
|
||||
---
|
||||
name: ha-frontend-browser-checks
|
||||
description: Check a Home Assistant frontend change in a browser and show it in a pull request. Use when checking how a change looks or behaves at different screen sizes, in light and dark mode, right to left (RTL) or with long translations, or when taking before and after screenshots or recording a demo of a feature for a pull request.
|
||||
---
|
||||
|
||||
# HA Frontend Browser Checks
|
||||
|
||||
Use this skill to check a visible change in a browser and to show it in a pull request. Any browser tool you already have works if it can open a page, set its size, run a script in it, take screenshots and record video. Load `ha-frontend-testing` for the dev servers, and `ha-frontend-loading` for loading states.
|
||||
|
||||
Screenshots and recordings help reviewers see what changed, but they don't make a large change easy to review. [Keep pull requests small](https://contributors.home-assistant.io/start/pull-requests/#keep-it-small), and make sure you have reviewed and understood the change and can explain it, as the [AI policy](https://contributors.home-assistant.io/start/ai-policy/) asks.
|
||||
|
||||
## Check Real Devices
|
||||
|
||||
Check the sizes the change affects rather than one fixed size, such as a phone, a tablet in both orientations, a laptop and a large desktop monitor. Include a small phone. Take each device's viewport in CSS pixels, its pixel ratio and touch support from the device presets your tools have, rather than from memory, and check the page really has that size once it's set.
|
||||
|
||||
## Check Light And Dark
|
||||
|
||||
When the change can look different in light and dark mode, such as a colour, border, background or image, check it in both. Switch the colour scheme in your browser tool, with the profile's theme following it, or pick light and dark in the profile. A fix for one mode only needs that mode.
|
||||
|
||||
## Check Right To Left (RTL)
|
||||
|
||||
Check layout, alignment, icons and anything with a direction in RTL. In the app, set your profile language to one written right to left, then set it back: many components take their direction from the language, so setting the page to RTL in your browser tool leaves them left to right. The gallery's RTL toggle checks styling only.
|
||||
|
||||
## Check Long Text
|
||||
|
||||
When a change adds or changes text, check it in a language with long words or long translations too, so labels, descriptions and buttons don't overflow or wrap badly. When the new string isn't translated yet, try a rough translation to check its length.
|
||||
|
||||
## Show It In The Pull Request
|
||||
|
||||
- When the change alters something that exists already, capture the same screen on `dev` and on your branch, in the same state, and put them side by side. Only a new screen, with nothing before it, needs just the after.
|
||||
- Keep the size of every capture fixed, screenshots as well as videos. Set the page size before you capture and don't change it in between, and capture the same area each time, so the subject sits in the same place in before and after. For a card or other part of the page, work out a fixed area around it for each size you test, and use that same area on both branches.
|
||||
- Say which device, size or mode each capture shows.
|
||||
- Make the change easy to see: capture the part of the screen it affects rather than a whole page where it's a few pixels.
|
||||
- Save captures outside the repository, so they can't be committed by accident.
|
||||
- Keep personal details out: use demo data, such as the demo or the Demo integration, and mask anything else before you capture, such as names, addresses, IP and MAC addresses, hostnames, serial numbers and tokens. Check each capture before you attach it.
|
||||
|
||||
Record a video when it shows the change better than a still, such as an animation, a drag, a loading sequence (hold the loading state as "Checking It" in `ha-frontend-loading` shows) or a flow across several screens. Keep each video short and small: GitHub limits upload sizes, and reviewers have to watch it. You can record it yourself with the tools you have; it doesn't need a person.
|
||||
|
||||
- Use the recording tools at hand: your browser tool's recorder for a page, or a desktop screen recorder for a window, such as a phone emulator, so the device frame shows.
|
||||
- Don't resize, zoom or take screenshots while recording, which redraw the page at another size and make the video jump.
|
||||
- Check the whole recording before you attach it. For a short clip, look at a frame every second or half second, not only the first and last, since the page can jump to another size partway through. Record again if it does. Take stills from the same frames, so they match the video.
|
||||
- Keep the window drawn on a screen. A hidden or minimised window records only a frame every few seconds.
|
||||
- Label each video, such as **Before** and **After**, and say what it shows and how you set it up. Say what you didn't record and why.
|
||||
@@ -20,7 +20,7 @@ When creating a pull request, use `.github/PULL_REQUEST_TEMPLATE.md` as the body
|
||||
- Do not omit, reorder, or rewrite template sections.
|
||||
- Check the appropriate "Type of change" box based on the actual change.
|
||||
- Do not check checklist items on behalf of the user.
|
||||
- If the PR includes UI changes, add screenshots or a short video, taken as `ha-frontend-browser-checks` describes. Only ask the user to add them when you can't take them yourself.
|
||||
- If the PR includes UI changes, remind the user to add screenshots or a short video.
|
||||
- Explain what the change does for users, not only implementation details.
|
||||
- Use Markdown.
|
||||
|
||||
|
||||
@@ -53,11 +53,10 @@ Detailed guidance lives in `.agents/skills/<name>/SKILL.md`. Load every matching
|
||||
- `ha-frontend-ux-readiness`: UI/UX routing that complements frontend review for new user experiences.
|
||||
- `ha-frontend-gallery`: gallery pages, demos, sidebar structure, content, and verification.
|
||||
- `ha-frontend-demo`: standalone demo structure, configurations, navigation, shared stubs, and verification.
|
||||
- `ha-frontend-browser-checks`: checking a change in a browser at real device sizes, in light and dark mode, right to left (RTL) and with long translations, and screenshots and recorded demos for pull requests.
|
||||
|
||||
## Pull Requests
|
||||
|
||||
When creating a pull request, use `.github/PULL_REQUEST_TEMPLATE.md` as the PR body. Preserve template sections, check only the appropriate type-of-change boxes, and do not check checklist items on behalf of the user. If the PR includes UI changes, add screenshots or a short video, taken as `ha-frontend-browser-checks` describes. Only ask the user to add them when you can't take them yourself.
|
||||
When creating a pull request, use `.github/PULL_REQUEST_TEMPLATE.md` as the PR body. Preserve template sections, check only the appropriate type-of-change boxes, and do not check checklist items on behalf of the user. If the PR includes UI changes, remind the user to add screenshots or a short video.
|
||||
|
||||
## AI policy
|
||||
|
||||
|
||||
+3
-3
@@ -79,7 +79,7 @@
|
||||
"@swc/helpers": "0.5.24",
|
||||
"@tsparticles/engine": "4.5.4",
|
||||
"@tsparticles/preset-links": "4.5.4",
|
||||
"@versatiles/style": "9.1.1",
|
||||
"@versatiles/style": "9.1.0",
|
||||
"@vibrant/color": "4.0.4",
|
||||
"@vvo/tzdb": "6.204.0",
|
||||
"@webcomponents/scoped-custom-element-registry": "0.0.11",
|
||||
@@ -110,7 +110,7 @@
|
||||
"lit-html": "3.3.3",
|
||||
"maplibre-gl": "6.19.0",
|
||||
"marked": "18.2.1",
|
||||
"memoize-one": "7.0.0",
|
||||
"memoize-one": "6.0.0",
|
||||
"nanoid": "6.0.2",
|
||||
"node-vibrant": "4.0.4",
|
||||
"object-hash": "3.0.0",
|
||||
@@ -214,7 +214,7 @@
|
||||
"terser-webpack-plugin": "5.6.1",
|
||||
"ts-lit-plugin": "2.0.2",
|
||||
"typescript": "6.0.3",
|
||||
"typescript-eslint": "8.74.0",
|
||||
"typescript-eslint": "8.73.0",
|
||||
"vite": "8.3.8",
|
||||
"vite-tsconfig-paths": "6.1.1",
|
||||
"vitest": "5.1.1",
|
||||
|
||||
Generated
+86
-86
@@ -316,8 +316,8 @@ importers:
|
||||
specifier: 4.5.4
|
||||
version: 4.5.4
|
||||
'@versatiles/style':
|
||||
specifier: 9.1.1
|
||||
version: 9.1.1([email protected])
|
||||
specifier: 9.1.0
|
||||
version: 9.1.0([email protected])
|
||||
'@vibrant/color':
|
||||
specifier: 4.0.4
|
||||
version: 4.0.4
|
||||
@@ -409,8 +409,8 @@ importers:
|
||||
specifier: 18.2.1
|
||||
version: 18.2.1
|
||||
memoize-one:
|
||||
specifier: 7.0.0
|
||||
version: 7.0.0
|
||||
specifier: 6.0.0
|
||||
version: 6.0.0
|
||||
nanoid:
|
||||
specifier: 6.0.2
|
||||
version: 6.0.2
|
||||
@@ -615,7 +615,7 @@ importers:
|
||||
version: 0.13.11([email protected])
|
||||
eslint-plugin-import-x:
|
||||
specifier: 4.18.1
|
||||
version: 4.18.1(@typescript-eslint/[email protected]4.0([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])
|
||||
version: 4.18.1(@typescript-eslint/[email protected]3.0([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])
|
||||
eslint-plugin-lit:
|
||||
specifier: 2.3.1
|
||||
version: 2.3.1([email protected]([email protected]))
|
||||
@@ -624,7 +624,7 @@ importers:
|
||||
version: 5.1.3([email protected]([email protected]))
|
||||
eslint-plugin-unused-imports:
|
||||
specifier: 4.4.1
|
||||
version: 4.4.1(@typescript-eslint/[email protected]4.0(@typescript-eslint/[email protected]4.0([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))
|
||||
version: 4.4.1(@typescript-eslint/[email protected]3.0(@typescript-eslint/[email protected]3.0([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))
|
||||
eslint-plugin-wc:
|
||||
specifier: 3.1.0
|
||||
version: 3.1.0([email protected]([email protected]))
|
||||
@@ -716,8 +716,8 @@ importers:
|
||||
specifier: 6.0.3
|
||||
version: 6.0.3
|
||||
typescript-eslint:
|
||||
specifier: 8.74.0
|
||||
version: 8.74.0([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
specifier: 8.73.0
|
||||
version: 8.73.0([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
vite:
|
||||
specifier: 8.3.8
|
||||
version: 8.3.8(@types/[email protected])([email protected])([email protected])
|
||||
@@ -2353,8 +2353,8 @@ packages:
|
||||
leaflet: ^1.9.3
|
||||
maplibre-gl: ^2.4.0 || ^3.3.1 || ^4.3.2 || ^5.0.0 || ^6.0.0
|
||||
|
||||
'@maplibre/maplibre-gl-style-spec@26.9.0':
|
||||
resolution: {integrity: sha512-cQZK2lG3d6I5FjriPZCgJx/LiVMpWqoVibF+cgp2mkQ/P4BIGOsrA3WsvLw1wB28Q9JU9v2fapsQUJUbjjwa6g==}
|
||||
'@maplibre/maplibre-gl-style-spec@26.8.0':
|
||||
resolution: {integrity: sha512-EClj+0m624zGw5gdCOsI5f88bYzkXfgoP2Sj5VGs2AYg9hZaPxvCumX5KDDs6aKFwl2ut+3jAeLhvrSz7hEsBQ==}
|
||||
hasBin: true
|
||||
|
||||
'@maplibre/[email protected]':
|
||||
@@ -3535,50 +3535,50 @@ packages:
|
||||
'@types/[email protected]':
|
||||
resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==}
|
||||
|
||||
'@typescript-eslint/[email protected]4.0':
|
||||
resolution: {integrity: sha512-z3KXk1+Vm+d82ZRplOoC89ho4Rf1da5ju6sx8//92GnN532U62DGPjECXkkVqtYzIv0zoJlpO39SX2Z9tk6LVw==}
|
||||
'@typescript-eslint/[email protected]3.0':
|
||||
resolution: {integrity: sha512-UkygMFer53Yzn29MCYFTHf34hGXf5KJhiDWfIm1tXtXRrym1CS6l5H9Y3yCtPWChpC0/f93H88gdj8tN0dd4kw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
'@typescript-eslint/parser': ^8.74.0
|
||||
'@typescript-eslint/parser': ^8.73.0
|
||||
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
|
||||
typescript: '>=4.8.4 <6.1.0'
|
||||
|
||||
'@typescript-eslint/[email protected]4.0':
|
||||
resolution: {integrity: sha512-ecr8AYdig7avVkxaHdQvxHnIJ/mOyliO4Gv/uWF8q69vBew/z3sexqBwHUZX5Vql+Ns0w4sH6gBLkICGbOvJkA==}
|
||||
'@typescript-eslint/[email protected]3.0':
|
||||
resolution: {integrity: sha512-AuL45bVcmssHfZ3Di3cs9Q0l4gBm4ZFVrJOQEE7VpqW+PVgQaEwSwazz4TVIiFabXkk6U51EprYDwqw+HR8ePw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
|
||||
typescript: '>=4.8.4 <6.1.0'
|
||||
|
||||
'@typescript-eslint/[email protected]4.0':
|
||||
resolution: {integrity: sha512-z/mymuE+JlEeSFIv3Mo70EvgG1Zz74Hl0IDfExfXutARAP834bt+MppTD7mVAwmZO0GdxdOAi0jbTam749eH6g==}
|
||||
'@typescript-eslint/[email protected]3.0':
|
||||
resolution: {integrity: sha512-/pEf8Rc4Mjk+qJnY0uO1+Gadeal8uv50xpuic+srG2vIVatA0XxvWMUeMtFvs6OCHqftiQ7/+qH4aehG5stzIA==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
typescript: '>=4.8.4 <6.1.0'
|
||||
|
||||
'@typescript-eslint/[email protected]4.0':
|
||||
resolution: {integrity: sha512-kpOdpu4CpWN5U38ox3f727DwWRBtUAVhyUJtqTBYe5gf2wYoxac7PgKP14txrxN7ICVtcjlLdzjqfRgpSnDKvQ==}
|
||||
'@typescript-eslint/[email protected]3.0':
|
||||
resolution: {integrity: sha512-/TjD738Iq2rzj5z0ixVOi+TsvgjAzZPLPaH1yWdDBytR/HTR5gMpyYWZeCe5WTQZLwk3ho8AV7U3muoQCRtXBQ==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@typescript-eslint/[email protected]4.0':
|
||||
resolution: {integrity: sha512-p07wAuaS6BjCYgOSXKJi4YhvTnAf7fiG37e9THcpnYaQEt2QiTTYZWKwUFNgeRiywiMudazhzgddAirZ0GgHtQ==}
|
||||
'@typescript-eslint/[email protected]3.0':
|
||||
resolution: {integrity: sha512-lmtCFOfYaJfpqZywGuXi4FpNtE+NQ+YLe3T0K9rtEDcW8ZuGWvfI++pj8r05sYMI8vWT2CYK4rWyedmD6Rp4og==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
typescript: '>=4.8.4 <6.1.0'
|
||||
|
||||
'@typescript-eslint/[email protected]4.0':
|
||||
resolution: {integrity: sha512-CV3Y3la8l3F9ANfxcfpgSSiQgJTe4IeLEoZV4O/gcW86Ugp8X6SKiQ0vm+QegXaRIbbDMokZZSF3A1CgiU/kPw==}
|
||||
'@typescript-eslint/[email protected]3.0':
|
||||
resolution: {integrity: sha512-MOC9i4xy1F7KcDde7Ip8jf1SrRiALb2Km4UWxGNjUE2YlhjIEo1ayE27GHIwIQyfWuHTmEonQT14uyurlyC6aA==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
|
||||
typescript: '>=4.8.4 <6.1.0'
|
||||
|
||||
'@typescript-eslint/[email protected]4.0':
|
||||
resolution: {integrity: sha512-MpnMrJCVNpP1iVL8NiHkQZgQqIMBH5ewDGUPBh1pqQXwFtMFjsl1M03QcYPXmv6stCKEiF0PN7CGbU1ZbXFzEA==}
|
||||
'@typescript-eslint/[email protected]3.0':
|
||||
resolution: {integrity: sha512-O/1ytYzflF16QDKXx4/qOXg1IuZp+n7hr9t+S0nv7N/2Tl8rJiNCshztV1gcSUvHbPtoX3+zmNbtSAyVbzxVfw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@typescript-eslint/[email protected]4.0':
|
||||
resolution: {integrity: sha512-wL348k6l92DNG+kPP5rVpKwNBoz7a3xRZy3TPKc1uymQttd7u7gcMv3eENmcuh4CjC4mO3FTM0DYstFXMyDLuw==}
|
||||
'@typescript-eslint/[email protected]3.0':
|
||||
resolution: {integrity: sha512-InjlBkSdWceIwIBWSwS3ENUp+i0O02PGX3Zv2wnihWJC1WDVGvG7mTHuf8b57uAaITj94d6tRPDH+sUEtXdRQQ==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
'@typescript/native': npm:typescript@>=7.1.0-dev.20261009.1 || >=7.1.0-beta <7.1.0-dev
|
||||
@@ -3587,15 +3587,15 @@ packages:
|
||||
'@typescript/native':
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/[email protected]4.0':
|
||||
resolution: {integrity: sha512-IpWXPxXXomzxyTcvjhZJexgdvtTR1TooLAPpuxzaGqQ8BHll1lf4Ysp/BTE/l0U5TJ+x1j7B4bEM8pLRrvY+XA==}
|
||||
'@typescript-eslint/[email protected]3.0':
|
||||
resolution: {integrity: sha512-j2SVJJvVkXdUL0WcEzo4vEH1mO1vIi8KlVukcYA2MgMZvYN2LlZR4PmsW+GTSxSW24j6Q/EP7+MOifLtg5hmsA==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
|
||||
typescript: '>=4.8.4 <6.1.0'
|
||||
|
||||
'@typescript-eslint/[email protected]4.0':
|
||||
resolution: {integrity: sha512-XSZmOtMUbWCBIM+2BK134FyMFxmll1mW2mPLk/PSwYQYzGIPMgJAqL929U4qXVizLv7Xq5b7r41/o7Ombuwk0g==}
|
||||
'@typescript-eslint/[email protected]3.0':
|
||||
resolution: {integrity: sha512-k4lsFVpRZICbltkIEEH4hZRkwXkqDF1GHBpClKQOHQY+RkoZAAuyc1ci3I6p+CB6v3U4jaHIUshc4RzzQXZWLg==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@typescript/[email protected]':
|
||||
@@ -3838,8 +3838,8 @@ packages:
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
'@versatiles/[email protected].1':
|
||||
resolution: {integrity: sha512-JMOuqOq+uOX2PQZORX5rm0fxrvEx5KUvz/Oxr1JIOtuWRjdO5izpXPfg9/s+DeImd3Xpt8BG05X/hL5rkmY+9Q==}
|
||||
'@versatiles/[email protected].0':
|
||||
resolution: {integrity: sha512-P2gLER3/VAOLGCMiumZ1hjHenlsAiI4mz1gPSak9ZAci0BgPYVfY+oo01MIYIfN4A+AvL1gfwZ3eC2vYQVqtlQ==}
|
||||
engines: {node: '>=20'}
|
||||
peerDependencies:
|
||||
maplibre-gl: '>=5.5.0'
|
||||
@@ -6197,8 +6197,8 @@ packages:
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==}
|
||||
|
||||
memoize-one@7.0.0:
|
||||
resolution: {integrity: sha512-2N/rFuzS9eTTDXVmo/PO86KmapXPCOqDgR3eOnmWW1NVW8YXGzXcTWMKiGq/VAsYVl42Pd8rQ2DMsoYunIATLw==}
|
||||
memoize-one@6.0.0:
|
||||
resolution: {integrity: sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-+y4mDxU4rvXXu5UDSGCGNiesFmwCHuefGMoPCO1WYucNYj7DsLqrFaa2fXVI0H+NNiPTwwzKwspn9yTZqUGqng==}
|
||||
@@ -7604,8 +7604,8 @@ packages:
|
||||
resolution: {integrity: sha512-phPGCwqr2+Qo0fwniCE8e4pKnGu/yFb5nD5Y8bf0EEeiI5GklnACYA9GFy/DrAeRrKHXvHn+1SUsOWgJp6RO+g==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
[email protected]4.0:
|
||||
resolution: {integrity: sha512-OsWQlsedt1ZpZXfZZMNK3m4SoQONFFcy4h/uRznsCeRfVuEic3gh4KGUs2pJJ5o0Jj0Jr7keUHQGN1Ns9aDw7Q==}
|
||||
[email protected]3.0:
|
||||
resolution: {integrity: sha512-+EnKy9rkYPun4l+kG2bDuYWQ6y1tGVgdR/tY1U9AC6h21CjEwOoc7gsjwe0FXB8uWFzk4QiCFbuRWgX758PiAg==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
|
||||
@@ -10228,7 +10228,7 @@ snapshots:
|
||||
leaflet: 1.9.4
|
||||
maplibre-gl: 6.19.0
|
||||
|
||||
'@maplibre/maplibre-gl-style-spec@26.9.0':
|
||||
'@maplibre/maplibre-gl-style-spec@26.8.0':
|
||||
dependencies:
|
||||
'@mapbox/jsonlint-lines-primitives': 2.0.3
|
||||
'@mapbox/unitbezier': 1.0.0
|
||||
@@ -11443,14 +11443,14 @@ snapshots:
|
||||
dependencies:
|
||||
'@types/node': 24.19.2
|
||||
|
||||
'@typescript-eslint/[email protected]4.0(@typescript-eslint/[email protected]4.0([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])':
|
||||
'@typescript-eslint/[email protected]3.0(@typescript-eslint/[email protected]3.0([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])':
|
||||
dependencies:
|
||||
'@eslint-community/regexpp': 4.12.2
|
||||
'@typescript-eslint/parser': 8.74.0([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/scope-manager': 8.74.0
|
||||
'@typescript-eslint/type-utils': 8.74.0([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/utils': 8.74.0([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/visitor-keys': 8.74.0
|
||||
'@typescript-eslint/parser': 8.73.0([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/scope-manager': 8.73.0
|
||||
'@typescript-eslint/type-utils': 8.73.0([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/utils': 8.73.0([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/visitor-keys': 8.73.0
|
||||
eslint: 10.15.0([email protected])
|
||||
ignore: 7.0.6
|
||||
natural-compare: 1.4.0
|
||||
@@ -11460,12 +11460,12 @@ snapshots:
|
||||
- '@typescript/native'
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/[email protected]4.0([email protected]([email protected]))([email protected])([email protected])([email protected])':
|
||||
'@typescript-eslint/[email protected]3.0([email protected]([email protected]))([email protected])([email protected])([email protected])':
|
||||
dependencies:
|
||||
'@typescript-eslint/scope-manager': 8.74.0
|
||||
'@typescript-eslint/types': 8.74.0
|
||||
'@typescript-eslint/typescript-estree': 8.74.0([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/visitor-keys': 8.74.0
|
||||
'@typescript-eslint/scope-manager': 8.73.0
|
||||
'@typescript-eslint/types': 8.73.0
|
||||
'@typescript-eslint/typescript-estree': 8.73.0([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/visitor-keys': 8.73.0
|
||||
debug: 4.4.3([email protected])
|
||||
eslint: 10.15.0([email protected])
|
||||
typescript: 6.0.3
|
||||
@@ -11473,29 +11473,29 @@ snapshots:
|
||||
- '@typescript/native'
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/[email protected]4.0([email protected])([email protected])':
|
||||
'@typescript-eslint/[email protected]3.0([email protected])([email protected])':
|
||||
dependencies:
|
||||
'@typescript-eslint/tsconfig-utils': 8.74.0([email protected])
|
||||
'@typescript-eslint/types': 8.74.0
|
||||
'@typescript-eslint/tsconfig-utils': 8.73.0([email protected])
|
||||
'@typescript-eslint/types': 8.73.0
|
||||
debug: 4.4.3([email protected])
|
||||
typescript: 6.0.3
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/[email protected]4.0':
|
||||
'@typescript-eslint/[email protected]3.0':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.74.0
|
||||
'@typescript-eslint/visitor-keys': 8.74.0
|
||||
'@typescript-eslint/types': 8.73.0
|
||||
'@typescript-eslint/visitor-keys': 8.73.0
|
||||
|
||||
'@typescript-eslint/[email protected]4.0([email protected])':
|
||||
'@typescript-eslint/[email protected]3.0([email protected])':
|
||||
dependencies:
|
||||
typescript: 6.0.3
|
||||
|
||||
'@typescript-eslint/[email protected]4.0([email protected]([email protected]))([email protected])([email protected])([email protected])':
|
||||
'@typescript-eslint/[email protected]3.0([email protected]([email protected]))([email protected])([email protected])([email protected])':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.74.0
|
||||
'@typescript-eslint/typescript-estree': 8.74.0([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/utils': 8.74.0([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/types': 8.73.0
|
||||
'@typescript-eslint/typescript-estree': 8.73.0([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/utils': 8.73.0([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
debug: 4.4.3([email protected])
|
||||
eslint: 10.15.0([email protected])
|
||||
ts-api-utils: 2.5.0([email protected])
|
||||
@@ -11504,14 +11504,14 @@ snapshots:
|
||||
- '@typescript/native'
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/[email protected]4.0': {}
|
||||
'@typescript-eslint/[email protected]3.0': {}
|
||||
|
||||
'@typescript-eslint/[email protected]4.0([email protected])([email protected])([email protected])':
|
||||
'@typescript-eslint/[email protected]3.0([email protected])([email protected])([email protected])':
|
||||
dependencies:
|
||||
'@typescript-eslint/project-service': 8.74.0([email protected])([email protected])
|
||||
'@typescript-eslint/tsconfig-utils': 8.74.0([email protected])
|
||||
'@typescript-eslint/types': 8.74.0
|
||||
'@typescript-eslint/visitor-keys': 8.74.0
|
||||
'@typescript-eslint/project-service': 8.73.0([email protected])([email protected])
|
||||
'@typescript-eslint/tsconfig-utils': 8.73.0([email protected])
|
||||
'@typescript-eslint/types': 8.73.0
|
||||
'@typescript-eslint/visitor-keys': 8.73.0
|
||||
debug: 4.4.3([email protected])
|
||||
minimatch: 11.0.5
|
||||
semver: 7.8.5
|
||||
@@ -11523,21 +11523,21 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/[email protected]4.0([email protected]([email protected]))([email protected])([email protected])([email protected])':
|
||||
'@typescript-eslint/[email protected]3.0([email protected]([email protected]))([email protected])([email protected])([email protected])':
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.10.1([email protected]([email protected]))
|
||||
'@typescript-eslint/scope-manager': 8.74.0
|
||||
'@typescript-eslint/types': 8.74.0
|
||||
'@typescript-eslint/typescript-estree': 8.74.0([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/scope-manager': 8.73.0
|
||||
'@typescript-eslint/types': 8.73.0
|
||||
'@typescript-eslint/typescript-estree': 8.73.0([email protected])([email protected])([email protected])
|
||||
eslint: 10.15.0([email protected])
|
||||
typescript: 6.0.3
|
||||
transitivePeerDependencies:
|
||||
- '@typescript/native'
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/[email protected]4.0':
|
||||
'@typescript-eslint/[email protected]3.0':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.74.0
|
||||
'@typescript-eslint/types': 8.73.0
|
||||
eslint-visitor-keys: 5.0.1
|
||||
|
||||
'@typescript/[email protected]':
|
||||
@@ -11670,9 +11670,9 @@ snapshots:
|
||||
'@unrs/[email protected]':
|
||||
optional: true
|
||||
|
||||
'@versatiles/[email protected].1([email protected])':
|
||||
'@versatiles/[email protected].0([email protected])':
|
||||
dependencies:
|
||||
'@maplibre/maplibre-gl-style-spec': 26.9.0
|
||||
'@maplibre/maplibre-gl-style-spec': 26.8.0
|
||||
optionalDependencies:
|
||||
maplibre-gl: 6.19.0
|
||||
|
||||
@@ -12870,9 +12870,9 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
[email protected](@typescript-eslint/[email protected]4.0([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected]):
|
||||
[email protected](@typescript-eslint/[email protected]3.0([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected]):
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.74.0
|
||||
'@typescript-eslint/types': 8.73.0
|
||||
cjs-module-lexer: 2.3.0
|
||||
comment-parser: 1.4.8
|
||||
debug: 4.4.3([email protected])
|
||||
@@ -12885,7 +12885,7 @@ snapshots:
|
||||
stable-hash-x: 0.2.0
|
||||
unrs-resolver: 1.12.2
|
||||
optionalDependencies:
|
||||
'@typescript-eslint/utils': 8.74.0([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/utils': 8.73.0([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
@@ -12909,11 +12909,11 @@ snapshots:
|
||||
parse5: 8.1.0
|
||||
parse5-htmlparser2-tree-adapter: 8.0.1
|
||||
|
||||
[email protected](@typescript-eslint/[email protected]4.0(@typescript-eslint/[email protected]4.0([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected])):
|
||||
[email protected](@typescript-eslint/[email protected]3.0(@typescript-eslint/[email protected]3.0([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected])):
|
||||
dependencies:
|
||||
eslint: 10.15.0([email protected])
|
||||
optionalDependencies:
|
||||
'@typescript-eslint/eslint-plugin': 8.74.0(@typescript-eslint/[email protected]4.0([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/eslint-plugin': 8.73.0(@typescript-eslint/[email protected]3.0([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
|
||||
[email protected]([email protected]([email protected])):
|
||||
dependencies:
|
||||
@@ -14150,7 +14150,7 @@ snapshots:
|
||||
'@mapbox/unitbezier': 1.0.0
|
||||
'@mapbox/vector-tile': 3.0.0
|
||||
'@maplibre/geojson-vt': 6.3.2
|
||||
'@maplibre/maplibre-gl-style-spec': 26.9.0
|
||||
'@maplibre/maplibre-gl-style-spec': 26.8.0
|
||||
'@maplibre/mlt': 1.3.0
|
||||
'@maplibre/vt-pbf': 4.3.3
|
||||
'@types/geojson': 7946.0.16
|
||||
@@ -14180,7 +14180,7 @@ snapshots:
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
memoize-one@7.0.0: {}
|
||||
memoize-one@6.0.0: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
@@ -15748,12 +15748,12 @@ snapshots:
|
||||
possible-typed-array-names: 1.1.0
|
||||
reflect.getprototypeof: 1.0.10
|
||||
|
||||
[email protected]4.0([email protected]([email protected]))([email protected])([email protected])([email protected]):
|
||||
[email protected]3.0([email protected]([email protected]))([email protected])([email protected])([email protected]):
|
||||
dependencies:
|
||||
'@typescript-eslint/eslint-plugin': 8.74.0(@typescript-eslint/[email protected]4.0([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/parser': 8.74.0([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/typescript-estree': 8.74.0([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/utils': 8.74.0([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/eslint-plugin': 8.73.0(@typescript-eslint/[email protected]3.0([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/parser': 8.73.0([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/typescript-estree': 8.73.0([email protected])([email protected])([email protected])
|
||||
'@typescript-eslint/utils': 8.73.0([email protected]([email protected]))([email protected])([email protected])([email protected])
|
||||
eslint: 10.15.0([email protected])
|
||||
typescript: 6.0.3
|
||||
transitivePeerDependencies:
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "home-assistant-frontend"
|
||||
version = "20261125.0"
|
||||
version = "20261125.1"
|
||||
license = "Apache-2.0"
|
||||
license-files = ["LICENSE*"]
|
||||
description = "The Home Assistant frontend"
|
||||
|
||||
+2
-2
@@ -126,9 +126,9 @@
|
||||
"matchPackageNames": ["echarts", "zrender"]
|
||||
},
|
||||
{
|
||||
"description": "Group formatjs monorepo packages",
|
||||
"description": "Group formatjs monorepo package",
|
||||
"groupName": "formatjs",
|
||||
"matchPackageNames": ["@formatjs/**", "intl-messageformat"]
|
||||
"matchPackageNames": ["@formatjs/**"]
|
||||
},
|
||||
{
|
||||
"description": "Group Playwright package and CI container updates",
|
||||
|
||||
@@ -235,7 +235,7 @@ export class HaCameraPlayer extends LitElement {
|
||||
const aspectRatio = this._aspectRatio();
|
||||
if (aspectRatio !== this._firedAspectRatio) {
|
||||
this._firedAspectRatio = aspectRatio;
|
||||
fireEvent(this, "media-size-changed", { aspectRatio });
|
||||
fireEvent(this, "camera-aspect-ratio-changed", { aspectRatio });
|
||||
}
|
||||
if (changedProps.has("keepAwake")) {
|
||||
if (this.keepAwake) {
|
||||
@@ -1189,7 +1189,6 @@ declare global {
|
||||
"ha-camera-player": HaCameraPlayer;
|
||||
}
|
||||
interface HASSDomEvents {
|
||||
/** The natural width limits the picture's width when it is set */
|
||||
"media-size-changed": { aspectRatio: number; naturalWidth?: number };
|
||||
"camera-aspect-ratio-changed": { aspectRatio: number };
|
||||
}
|
||||
}
|
||||
@@ -328,11 +328,6 @@ export function generateStatisticsChartData(
|
||||
: undefined,
|
||||
color: chartType === "bar" ? backgroundColor : borderColor,
|
||||
};
|
||||
if (chartType === "bar") {
|
||||
// echarts sizes bars from the smallest gap between points, so sparse
|
||||
// data (one point, or points far apart) gets huge bars without a cap
|
||||
(series as BarSeriesOption).barMaxWidth = 50;
|
||||
}
|
||||
if (chartStacked) {
|
||||
series.stack = `band-stacked`;
|
||||
series.stackStrategy = "samesign";
|
||||
|
||||
@@ -179,10 +179,6 @@ export class HaControlCircularSlider extends LitElement {
|
||||
|
||||
disconnectedCallback(): void {
|
||||
super.disconnectedCallback();
|
||||
this._destroyListeners();
|
||||
if (this._activeSlider) {
|
||||
this._cancelInteraction();
|
||||
}
|
||||
}
|
||||
|
||||
private _managers: HammerManager[] = [];
|
||||
@@ -252,18 +248,6 @@ export class HaControlCircularSlider extends LitElement {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private _cancelInteraction() {
|
||||
if (this._activeSlider) {
|
||||
fireEvent(this, `${this._activeSlider}-changing`, {
|
||||
value: undefined,
|
||||
});
|
||||
}
|
||||
this._activeSlider = undefined;
|
||||
this._localValue = this.value;
|
||||
this._localLow = this.low;
|
||||
this._localHigh = this.high;
|
||||
}
|
||||
|
||||
private _setupListeners() {
|
||||
if (this._interactions && this._managers.length === 0) {
|
||||
this._interactions.forEach((interaction) => {
|
||||
@@ -295,7 +279,15 @@ export class HaControlCircularSlider extends LitElement {
|
||||
mc.add(new Tap({ event: "singletap" }));
|
||||
|
||||
const cancelInteraction = () => {
|
||||
this._cancelInteraction();
|
||||
if (this._activeSlider) {
|
||||
fireEvent(this, `${this._activeSlider}-changing`, {
|
||||
value: undefined,
|
||||
});
|
||||
}
|
||||
this._activeSlider = undefined;
|
||||
this._localValue = this.value;
|
||||
this._localLow = this.low;
|
||||
this._localHigh = this.high;
|
||||
if (pressToActivate) {
|
||||
panRecognizer.set({ enable: false });
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ function adjustRgb(
|
||||
if (wv != null) {
|
||||
return rgbw2rgb([...rgb, wv] as [number, number, number, number]);
|
||||
}
|
||||
if (cw != null && ww != null) {
|
||||
if (cw != null && ww !== null) {
|
||||
return rgbww2rgb(
|
||||
[...rgb, cw, ww] as [number, number, number, number, number],
|
||||
minKelvin,
|
||||
|
||||
@@ -2,8 +2,6 @@ import { css, html, LitElement, nothing } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators";
|
||||
import { consume } from "../../../common/decorators/consume";
|
||||
import { transform } from "../../../common/decorators/transform";
|
||||
import type { HASSDomCurrentTargetEvent } from "../../../common/dom/fire_event";
|
||||
import { fireEvent } from "../../../common/dom/fire_event";
|
||||
import { connectionContext, formattersContext } from "../../../data/context";
|
||||
import type { ImageEntity } from "../../../data/image";
|
||||
import { computeImageUrl } from "../../../data/image";
|
||||
@@ -30,17 +28,6 @@ class MoreInfoImage extends LitElement {
|
||||
|
||||
@property({ attribute: false }) public stateObj?: ImageEntity;
|
||||
|
||||
private _size?: HASSDomEvents["media-size-changed"];
|
||||
|
||||
public connectedCallback() {
|
||||
super.connectedCallback();
|
||||
// A cached view that was detached while the picture loaded couldn't send
|
||||
// its size, and the picture doesn't load again when it's shown
|
||||
if (this._size) {
|
||||
fireEvent(this, "media-size-changed", this._size);
|
||||
}
|
||||
}
|
||||
|
||||
protected render() {
|
||||
if (!this._connection || !this.stateObj) {
|
||||
return nothing;
|
||||
@@ -52,28 +39,16 @@ class MoreInfoImage extends LitElement {
|
||||
return html`<img
|
||||
alt=${this._formatEntityName?.(this.stateObj) || this.stateObj.entity_id}
|
||||
src=${this._connection.hassUrl(imageUrl)}
|
||||
@load=${this._imageLoaded}
|
||||
/> `;
|
||||
}
|
||||
|
||||
private _imageLoaded(ev: HASSDomCurrentTargetEvent<HTMLImageElement>) {
|
||||
const { naturalWidth, naturalHeight } = ev.currentTarget;
|
||||
if (!naturalWidth || !naturalHeight) {
|
||||
return;
|
||||
}
|
||||
this._size = { aspectRatio: naturalWidth / naturalHeight, naturalWidth };
|
||||
fireEvent(this, "media-size-changed", this._size);
|
||||
}
|
||||
|
||||
static styles = css`
|
||||
:host {
|
||||
display: block;
|
||||
text-align: center;
|
||||
}
|
||||
img {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
max-width: 100%;
|
||||
max-height: var(--more-info-media-max-height, none);
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
@@ -149,12 +149,10 @@ export class MoreInfoDialog extends DirtyStateProviderMixin<
|
||||
|
||||
@property({ type: Boolean, reflect: true }) public large = false;
|
||||
|
||||
// The dialog grows with the camera's or image's picture, as high as there
|
||||
// is room for
|
||||
@state() private _mediaAspectRatio?: number;
|
||||
@state() private _fill = false;
|
||||
|
||||
// An image is not shown larger than it is
|
||||
@state() private _mediaNaturalWidth?: number;
|
||||
// The dialog grows with the camera's picture, as high as there is room for
|
||||
@state() private _cameraAspectRatio?: number;
|
||||
|
||||
// Height of the controls the camera's info shows below the picture
|
||||
@state() private _cameraControlsHeight?: string;
|
||||
@@ -198,6 +196,12 @@ export class MoreInfoDialog extends DirtyStateProviderMixin<
|
||||
}
|
||||
|
||||
public showDialog(params: MoreInfoDialogParams) {
|
||||
// The camera player keeps running for the same entity and doesn't send
|
||||
// its size again
|
||||
if (params.entityId !== this._entityId) {
|
||||
this._cameraAspectRatio = undefined;
|
||||
this._cameraControlsHeight = undefined;
|
||||
}
|
||||
this._entityId = params.entityId;
|
||||
if (!this._entityId) {
|
||||
this.closeDialog();
|
||||
@@ -215,6 +219,7 @@ export class MoreInfoDialog extends DirtyStateProviderMixin<
|
||||
this._detailsYamlMode = false;
|
||||
|
||||
this.large = params.large ?? false;
|
||||
this._fill = false;
|
||||
this._open = true;
|
||||
this._loadEntityRegistryEntry();
|
||||
}
|
||||
@@ -260,6 +265,8 @@ export class MoreInfoDialog extends DirtyStateProviderMixin<
|
||||
this._currView = DEFAULT_VIEW;
|
||||
this._childViewStack = [];
|
||||
this._returnUrl = undefined;
|
||||
this._cameraAspectRatio = undefined;
|
||||
this._cameraControlsHeight = undefined;
|
||||
this._isEscapeEnabled = true;
|
||||
window.removeEventListener("dialog-closed", this._enableEscapeKeyClose);
|
||||
window.removeEventListener("show-dialog", this._disableEscapeKeyClose);
|
||||
@@ -684,32 +691,30 @@ export class MoreInfoDialog extends DirtyStateProviderMixin<
|
||||
`
|
||||
: nothing;
|
||||
|
||||
// Also when it was opened from a smaller entity's related view
|
||||
const mediaAspectRatio =
|
||||
(domain === "camera" || domain === "image") && isDefaultView
|
||||
? this._mediaAspectRatio
|
||||
// Also when the camera was opened from a smaller entity's related view
|
||||
const cameraAspectRatio =
|
||||
domain === "camera" && isDefaultView
|
||||
? this._cameraAspectRatio
|
||||
: undefined;
|
||||
// As wide as the picture is when it's as high as there is room for
|
||||
const fullHeightWidth = `var(--more-info-media-max-height) * ${mediaAspectRatio}`;
|
||||
const mediaPictureWidth = this._mediaNaturalWidth
|
||||
? `min(${fullHeightWidth}, ${this._mediaNaturalWidth}px)`
|
||||
: fullHeightWidth;
|
||||
|
||||
return html`
|
||||
<ha-adaptive-dialog
|
||||
.open=${this._open}
|
||||
.width=${this.large || mediaAspectRatio ? "large" : "medium"}
|
||||
class=${classMap({
|
||||
camera: domain === "camera",
|
||||
image: domain === "image",
|
||||
})}
|
||||
.width=${
|
||||
this._fill
|
||||
? "full"
|
||||
: this.large || cameraAspectRatio
|
||||
? "large"
|
||||
: "medium"
|
||||
}
|
||||
class=${classMap({ camera: domain === "camera" })}
|
||||
style=${styleMap({
|
||||
"--more-info-camera-controls-height": this._cameraControlsHeight,
|
||||
"--ha-dialog-width-lg": mediaAspectRatio
|
||||
? `clamp(var(--ha-dialog-width-md, 580px), calc(${mediaPictureWidth} + var(--more-info-media-inline-padding, 0px)), 1920px)`
|
||||
"--ha-dialog-width-lg": cameraAspectRatio
|
||||
? `clamp(var(--ha-dialog-width-md, 580px), calc(var(--video-max-height) * ${cameraAspectRatio}), 1920px)`
|
||||
: undefined,
|
||||
})}
|
||||
@media-size-changed=${this._mediaSizeChanged}
|
||||
@camera-aspect-ratio-changed=${this._cameraAspectRatioChanged}
|
||||
@camera-controls-height-changed=${this._cameraControlsHeightChanged}
|
||||
.accessibleLabel=${title}
|
||||
@closed=${this._dialogClosed}
|
||||
@@ -742,7 +747,7 @@ export class MoreInfoDialog extends DirtyStateProviderMixin<
|
||||
></ha-icon-button-prev>
|
||||
`
|
||||
}
|
||||
<span slot="headerTitle" class="title">
|
||||
<span slot="headerTitle" @click=${this._enlarge} class="title">
|
||||
${
|
||||
breadcrumb.length > 0
|
||||
? !__DEMO__ && isAdmin
|
||||
@@ -1066,17 +1071,6 @@ export class MoreInfoDialog extends DirtyStateProviderMixin<
|
||||
`;
|
||||
}
|
||||
|
||||
protected willUpdate(changedProps: PropertyValues) {
|
||||
super.willUpdate(changedProps);
|
||||
// Also when going to a related entity or back. The camera player or image
|
||||
// of the same entity keeps running and doesn't send its size again.
|
||||
if (changedProps.has("_entityId")) {
|
||||
this._mediaAspectRatio = undefined;
|
||||
this._mediaNaturalWidth = undefined;
|
||||
this._cameraControlsHeight = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
protected firstUpdated(changedProps: PropertyValues<this>) {
|
||||
super.firstUpdated(changedProps);
|
||||
this.addEventListener("close-dialog", () => this.closeDialog());
|
||||
@@ -1146,11 +1140,10 @@ export class MoreInfoDialog extends DirtyStateProviderMixin<
|
||||
this._entry = ev.detail;
|
||||
}
|
||||
|
||||
private _mediaSizeChanged(
|
||||
ev: HASSDomEvent<HASSDomEvents["media-size-changed"]>
|
||||
private _cameraAspectRatioChanged(
|
||||
ev: HASSDomEvent<HASSDomEvents["camera-aspect-ratio-changed"]>
|
||||
) {
|
||||
this._mediaAspectRatio = ev.detail.aspectRatio;
|
||||
this._mediaNaturalWidth = ev.detail.naturalWidth;
|
||||
this._cameraAspectRatio = ev.detail.aspectRatio;
|
||||
}
|
||||
|
||||
private _cameraControlsHeightChanged(
|
||||
@@ -1159,6 +1152,12 @@ export class MoreInfoDialog extends DirtyStateProviderMixin<
|
||||
this._cameraControlsHeight = ev.detail.height;
|
||||
}
|
||||
|
||||
private _enlarge() {
|
||||
withViewTransition(() => {
|
||||
this._fill = !this._fill;
|
||||
});
|
||||
}
|
||||
|
||||
private _handleOpened() {
|
||||
window.addEventListener("dialog-closed", this._enableEscapeKeyClose);
|
||||
window.addEventListener("show-dialog", this._disableEscapeKeyClose);
|
||||
@@ -1217,14 +1216,12 @@ export class MoreInfoDialog extends DirtyStateProviderMixin<
|
||||
--dialog-content-padding: 0;
|
||||
}
|
||||
|
||||
/* The dialog's margin, the safe area like the dialog's height limit,
|
||||
its header of about 68px and what the info shows besides the
|
||||
picture */
|
||||
ha-adaptive-dialog.camera,
|
||||
ha-adaptive-dialog.image {
|
||||
--more-info-media-max-height: calc(
|
||||
100vh - var(--ha-space-20) - var(--safe-area-inset-y, 0px) -
|
||||
68px - var(--more-info-media-reserved-height, 0px)
|
||||
/* The dialog's margin, its header of about 68px and the controls
|
||||
below the picture */
|
||||
ha-adaptive-dialog.camera {
|
||||
--video-max-height: calc(
|
||||
100vh - var(--ha-space-20) -
|
||||
68px - var(--more-info-camera-controls-height, 0px)
|
||||
);
|
||||
/* Along with the height of the picture */
|
||||
--ha-dialog-width-transition:
|
||||
@@ -1235,33 +1232,14 @@ export class MoreInfoDialog extends DirtyStateProviderMixin<
|
||||
/* A custom property takes any value, so it can't fall back to the
|
||||
declaration before it. svh like the height limit of the dialog. */
|
||||
@supports (height: 1svh) {
|
||||
ha-adaptive-dialog.camera,
|
||||
ha-adaptive-dialog.image {
|
||||
--more-info-media-max-height: calc(
|
||||
100svh - var(--ha-space-20) - var(--safe-area-inset-y, 0px) -
|
||||
68px - var(--more-info-media-reserved-height, 0px)
|
||||
ha-adaptive-dialog.camera {
|
||||
--video-max-height: calc(
|
||||
100svh - var(--ha-space-20) -
|
||||
68px - var(--more-info-camera-controls-height, 0px)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ha-adaptive-dialog.camera {
|
||||
--more-info-media-reserved-height: var(
|
||||
--more-info-camera-controls-height,
|
||||
0px
|
||||
);
|
||||
--video-max-height: var(--more-info-media-max-height);
|
||||
}
|
||||
|
||||
/* The info's padding around the picture and the entity's row of 40px
|
||||
above it, with 16px between them */
|
||||
ha-adaptive-dialog.image {
|
||||
--more-info-media-reserved-height: calc(
|
||||
var(--ha-space-6) +
|
||||
max(var(--safe-area-inset-bottom, 0px), var(--ha-space-6)) + 56px
|
||||
);
|
||||
--more-info-media-inline-padding: calc(var(--ha-space-6) * 2);
|
||||
}
|
||||
|
||||
.content-wrapper {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { HassEntity } from "home-assistant-js-websocket";
|
||||
import type { PropertyValues } from "lit";
|
||||
import { html, LitElement, nothing } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators";
|
||||
import { live } from "lit/directives/live";
|
||||
import { consume } from "../../../common/decorators/consume";
|
||||
import {
|
||||
consumeEntityState,
|
||||
@@ -140,7 +139,7 @@ class HuiNumericInputCardFeature
|
||||
return html`
|
||||
<ha-control-number-buttons
|
||||
.label=${label}
|
||||
.value=${live(value)}
|
||||
.value=${value}
|
||||
.min=${stateObj.attributes.min}
|
||||
.max=${stateObj.attributes.max}
|
||||
.step=${stateObj.attributes.step}
|
||||
@@ -154,7 +153,7 @@ class HuiNumericInputCardFeature
|
||||
return html`
|
||||
<ha-control-slider
|
||||
.label=${label}
|
||||
.value=${live(value)}
|
||||
.value=${value}
|
||||
.min=${stateObj.attributes.min}
|
||||
.max=${stateObj.attributes.max}
|
||||
.step=${stateObj.attributes.step}
|
||||
|
||||
@@ -1,145 +0,0 @@
|
||||
import type { HassEntity } from "home-assistant-js-websocket";
|
||||
import type { PropertyValues } from "lit";
|
||||
import { LitElement, css, html, nothing } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators";
|
||||
import { styleMap } from "lit/directives/style-map";
|
||||
import { consume } from "../../../common/decorators/consume";
|
||||
import durationToSeconds from "../../../common/datetime/duration_to_seconds";
|
||||
import { consumeEntityState } from "../../../common/decorators/consume-context-entry";
|
||||
import { computeDomain } from "../../../common/entity/compute_domain";
|
||||
import type { HomeAssistant } from "../../../types";
|
||||
import type { LovelaceCardFeature } from "../types";
|
||||
import { cardFeatureStyles } from "./common/card-feature-styles";
|
||||
import type {
|
||||
LovelaceCardFeatureContext,
|
||||
TimerProgressCardFeatureConfig,
|
||||
} from "./types";
|
||||
import { TimerRemainingTimeController } from "../../../common/controllers/timer-remaining-time-controller";
|
||||
import { reducedMotionContext } from "../../../data/context";
|
||||
|
||||
export const supportsTimerProgressCardFeature = (
|
||||
hass: HomeAssistant,
|
||||
context: LovelaceCardFeatureContext
|
||||
) => {
|
||||
const stateObj = context.entity_id
|
||||
? hass.states[context.entity_id]
|
||||
: undefined;
|
||||
return !!stateObj && computeDomain(stateObj.entity_id) === "timer";
|
||||
};
|
||||
|
||||
@customElement("hui-timer-progress-card-feature")
|
||||
class HuiTimerProgressCardFeature
|
||||
extends LitElement
|
||||
implements LovelaceCardFeature
|
||||
{
|
||||
@property({ attribute: false }) public context?: LovelaceCardFeatureContext;
|
||||
|
||||
@state()
|
||||
@consumeEntityState({ entityIdPath: ["context", "entity_id"] })
|
||||
private _stateObj?: HassEntity;
|
||||
|
||||
@state()
|
||||
@consume({ context: reducedMotionContext, subscribe: true })
|
||||
private _reducedMotion = false;
|
||||
|
||||
@state() private _config?: TimerProgressCardFeatureConfig;
|
||||
private _timeRemaining = new TimerRemainingTimeController(this);
|
||||
private _prevRatio = 0;
|
||||
private _animate = false;
|
||||
|
||||
static getStubConfig(): TimerProgressCardFeatureConfig {
|
||||
return { type: "timer-progress" };
|
||||
}
|
||||
|
||||
public setConfig(config: TimerProgressCardFeatureConfig): void {
|
||||
if (!config) {
|
||||
throw new Error("Invalid configuration");
|
||||
}
|
||||
this._config = config;
|
||||
}
|
||||
|
||||
protected update(changedProps: PropertyValues): void {
|
||||
if (changedProps.has("_stateObj")) {
|
||||
this._timeRemaining.setStateObj(this._stateObj);
|
||||
}
|
||||
if (this._stateObj) {
|
||||
const ratio = this._ratio(this._stateObj);
|
||||
this._animate =
|
||||
!this._reducedMotion &&
|
||||
this._stateObj.state === "active" &&
|
||||
ratio <= this._prevRatio;
|
||||
this._prevRatio = ratio;
|
||||
}
|
||||
super.update(changedProps);
|
||||
}
|
||||
|
||||
private _ratio(stateObj: HassEntity, offset = 0): number {
|
||||
const { duration } = stateObj.attributes;
|
||||
const total =
|
||||
typeof duration === "string" ? durationToSeconds(duration) : 0;
|
||||
if (!total || stateObj.state === "idle") {
|
||||
return 0;
|
||||
}
|
||||
const left = (this._timeRemaining.timeRemaining ?? 0) - offset;
|
||||
return Math.min(Math.max(left / total, 0), 1);
|
||||
}
|
||||
|
||||
protected render() {
|
||||
if (
|
||||
!this._config ||
|
||||
!this.context ||
|
||||
!this._stateObj ||
|
||||
computeDomain(this._stateObj.entity_id) !== "timer"
|
||||
) {
|
||||
return nothing;
|
||||
}
|
||||
const stateObj = this._stateObj;
|
||||
const ratio = this._ratio(stateObj);
|
||||
const target = this._animate ? this._ratio(stateObj, 1) : ratio;
|
||||
return html`
|
||||
<div
|
||||
class="track"
|
||||
role="progressbar"
|
||||
aria-label=${stateObj.attributes.friendly_name || stateObj.entity_id}
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="100"
|
||||
aria-valuenow=${Math.round(ratio * 100)}
|
||||
>
|
||||
<div
|
||||
class="bar"
|
||||
style=${styleMap({
|
||||
transform: `scaleX(${target})`,
|
||||
transition: this._animate ? "transform 1s linear" : "none",
|
||||
})}
|
||||
></div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
static styles = [
|
||||
cardFeatureStyles,
|
||||
css`
|
||||
:host {
|
||||
pointer-events: none !important;
|
||||
}
|
||||
.track {
|
||||
height: var(--feature-height);
|
||||
border-radius: var(--feature-border-radius);
|
||||
background: color-mix(in srgb, var(--feature-color) 20%, transparent);
|
||||
overflow: hidden;
|
||||
}
|
||||
.bar {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
transform-origin: var(--float-start, left);
|
||||
background: var(--feature-color);
|
||||
}
|
||||
`,
|
||||
];
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
"hui-timer-progress-card-feature": HuiTimerProgressCardFeature;
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,6 @@ import { supportsTargetHumidityCardFeature } from "./hui-target-humidity-card-fe
|
||||
import { supportsTargetTemperatureCardFeature } from "./hui-target-temperature-card-feature";
|
||||
import { supportsTimerActionsCardFeature } from "./hui-timer-actions-card-feature";
|
||||
import { supportsTimerPresetsCardFeature } from "./hui-timer-presets-card-feature";
|
||||
import { supportsTimerProgressCardFeature } from "./hui-timer-progress-card-feature";
|
||||
import { supportsToggleCardFeature } from "./hui-toggle-card-feature";
|
||||
import { supportsTrendGraphCardFeature } from "./hui-trend-graph-card-feature";
|
||||
import { supportsUpdateActionsCardFeature } from "./hui-update-actions-card-feature";
|
||||
@@ -111,7 +110,6 @@ export const UI_FEATURE_TYPES = [
|
||||
"target-temperature",
|
||||
"timer-actions",
|
||||
"timer-presets",
|
||||
"timer-progress",
|
||||
"toggle",
|
||||
"update-actions",
|
||||
"vacuum-commands",
|
||||
@@ -171,7 +169,6 @@ export const SUPPORTS_FEATURE_TYPES: Record<UiFeatureType, SupportsFeature> = {
|
||||
"temperature-forecast": supportsTemperatureForecastCardFeature,
|
||||
"timer-actions": supportsTimerActionsCardFeature,
|
||||
"timer-presets": supportsTimerPresetsCardFeature,
|
||||
"timer-progress": supportsTimerProgressCardFeature,
|
||||
toggle: supportsToggleCardFeature,
|
||||
"update-actions": supportsUpdateActionsCardFeature,
|
||||
"vacuum-commands": supportsVacuumCommandsCardFeature,
|
||||
|
||||
@@ -237,10 +237,6 @@ export interface TimerPresetsCardFeatureConfig {
|
||||
style?: "buttons" | "dropdown";
|
||||
}
|
||||
|
||||
export interface TimerProgressCardFeatureConfig {
|
||||
type: "timer-progress";
|
||||
}
|
||||
|
||||
export interface WaterHeaterOperationModesCardFeatureConfig {
|
||||
type: "water-heater-operation-modes";
|
||||
style?: "dropdown" | "icons";
|
||||
@@ -410,7 +406,6 @@ export type LovelaceCardFeatureConfig =
|
||||
| TargetTemperatureCardFeatureConfig
|
||||
| TimerActionsCardFeatureConfig
|
||||
| TimerPresetsCardFeatureConfig
|
||||
| TimerProgressCardFeatureConfig
|
||||
| ToggleCardFeatureConfig
|
||||
| UpdateActionsCardFeatureConfig
|
||||
| VacuumCommandsCardFeatureConfig
|
||||
|
||||
@@ -84,7 +84,7 @@ const DOMAIN_VARIANTS: Record<string, TileVariant[]> = {
|
||||
],
|
||||
alarm_control_panel: [TILE_VARIANT, ["alarm-modes"]],
|
||||
counter: [TILE_VARIANT, ["counter-actions"]],
|
||||
timer: [TILE_VARIANT, ["timer-actions"], ["timer-progress"]],
|
||||
timer: [TILE_VARIANT, ["timer-actions"]],
|
||||
input_select: SELECT_VARIANTS,
|
||||
select: SELECT_VARIANTS,
|
||||
input_number: NUMERIC_INPUT_VARIANTS,
|
||||
|
||||
@@ -38,7 +38,6 @@ import "../card-features/hui-target-humidity-card-feature";
|
||||
import "../card-features/hui-target-temperature-card-feature";
|
||||
import "../card-features/hui-timer-actions-card-feature";
|
||||
import "../card-features/hui-timer-presets-card-feature";
|
||||
import "../card-features/hui-timer-progress-card-feature";
|
||||
import "../card-features/hui-toggle-card-feature";
|
||||
import "../card-features/hui-update-actions-card-feature";
|
||||
import "../card-features/hui-vacuum-commands-card-feature";
|
||||
@@ -105,7 +104,6 @@ const TYPES = new Set<LovelaceCardFeatureConfig["type"]>([
|
||||
"temperature-forecast",
|
||||
"timer-actions",
|
||||
"timer-presets",
|
||||
"timer-progress",
|
||||
"toggle",
|
||||
"update-actions",
|
||||
"vacuum-commands",
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import {
|
||||
mdiClose,
|
||||
mdiFullscreen,
|
||||
mdiFullscreenExit,
|
||||
mdiHelpCircleOutline,
|
||||
} from "@mdi/js";
|
||||
import { mdiClose, mdiHelpCircleOutline } from "@mdi/js";
|
||||
import deepFreeze from "deep-freeze";
|
||||
import type { CSSResultGroup, PropertyValues } from "lit";
|
||||
import { css, html, LitElement, nothing } from "lit";
|
||||
@@ -73,8 +68,6 @@ export class HuiDialogEditBadge
|
||||
|
||||
@state() private _open = false;
|
||||
|
||||
@state() private _animateWidth = false;
|
||||
|
||||
@state() private _badgeConfig?: LovelaceBadgeConfig;
|
||||
|
||||
@state() private _saving = false;
|
||||
@@ -202,8 +195,6 @@ export class HuiDialogEditBadge
|
||||
.open=${this._open}
|
||||
.accessibleLabel=${heading}
|
||||
.width=${this.large ? "full" : "large"}
|
||||
class=${this._animateWidth ? "animate-width" : ""}
|
||||
@dialog-set-fullscreen=${this._stopWidthAnimation}
|
||||
.preventScrimClose=${this.isEffectiveDirtyState}
|
||||
@keydown=${this._ignoreKeydown}
|
||||
@closed=${this._dialogClosed}
|
||||
@@ -214,18 +205,12 @@ export class HuiDialogEditBadge
|
||||
.label=${this.hass.localize("ui.common.close")}
|
||||
.path=${mdiClose}
|
||||
></ha-icon-button>
|
||||
<span slot="headerTitle">${heading}</span>
|
||||
<ha-icon-button
|
||||
slot="headerActionItems"
|
||||
class="enlarge"
|
||||
.path=${this.large ? mdiFullscreenExit : mdiFullscreen}
|
||||
.label=${this.hass.localize(
|
||||
this.large
|
||||
? "ui.panel.lovelace.editor.edit_badge.shrink"
|
||||
: "ui.panel.lovelace.editor.edit_badge.enlarge"
|
||||
)}
|
||||
@click=${this._toggleLarge}
|
||||
></ha-icon-button>
|
||||
<span
|
||||
slot="headerTitle"
|
||||
class="title-enlargeable"
|
||||
@click=${this._enlarge}
|
||||
>${heading}</span
|
||||
>
|
||||
${
|
||||
this._documentationURL !== undefined
|
||||
? html`
|
||||
@@ -319,14 +304,10 @@ export class HuiDialogEditBadge
|
||||
`;
|
||||
}
|
||||
|
||||
private _toggleLarge() {
|
||||
this._animateWidth = true;
|
||||
this.large = !this.large;
|
||||
}
|
||||
|
||||
// The code editor's fullscreen changes the height at once, so the width must not lag behind
|
||||
private _stopWidthAnimation() {
|
||||
this._animateWidth = false;
|
||||
private _enlarge() {
|
||||
withViewTransition(() => {
|
||||
this.large = !this.large;
|
||||
});
|
||||
}
|
||||
|
||||
private _ignoreKeydown(ev: KeyboardEvent) {
|
||||
@@ -513,18 +494,8 @@ export class HuiDialogEditBadge
|
||||
ha-dialog ha-icon-button[slot="headerActionItems"] {
|
||||
color: var(--secondary-text-color);
|
||||
}
|
||||
ha-dialog.animate-width {
|
||||
--ha-dialog-width-transition:
|
||||
min-width var(--ha-animation-duration-normal) ease-out,
|
||||
max-width var(--ha-animation-duration-normal) ease-out;
|
||||
}
|
||||
ha-dialog[fullscreen] .enlarge {
|
||||
display: none;
|
||||
}
|
||||
@media (max-width: 999px) {
|
||||
.enlarge {
|
||||
display: none;
|
||||
}
|
||||
.title-enlargeable {
|
||||
display: block;
|
||||
}
|
||||
`,
|
||||
];
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import {
|
||||
mdiClose,
|
||||
mdiFullscreen,
|
||||
mdiFullscreenExit,
|
||||
mdiHelpCircleOutline,
|
||||
} from "@mdi/js";
|
||||
import { mdiClose, mdiHelpCircleOutline } from "@mdi/js";
|
||||
import deepFreeze from "deep-freeze";
|
||||
import type { CSSResultGroup, PropertyValues } from "lit";
|
||||
import { LitElement, css, html, nothing } from "lit";
|
||||
@@ -81,8 +76,6 @@ export class HuiDialogEditCard
|
||||
|
||||
@state() private _open = false;
|
||||
|
||||
@state() private _animateWidth = false;
|
||||
|
||||
@state() private _cardConfig?: LovelaceCardConfig;
|
||||
|
||||
@state() private _sectionConfig?: LovelaceSectionConfig;
|
||||
@@ -214,8 +207,6 @@ export class HuiDialogEditCard
|
||||
.open=${this._open}
|
||||
.accessibleLabel=${heading}
|
||||
.width=${this.large ? "full" : "large"}
|
||||
class=${this._animateWidth ? "animate-width" : ""}
|
||||
@dialog-set-fullscreen=${this._stopWidthAnimation}
|
||||
.preventScrimClose=${this.isEffectiveDirtyState}
|
||||
@keydown=${this._ignoreKeydown}
|
||||
@closed=${this._dialogClosed}
|
||||
@@ -226,18 +217,12 @@ export class HuiDialogEditCard
|
||||
.label=${this.hass.localize("ui.common.close")}
|
||||
.path=${mdiClose}
|
||||
></ha-icon-button>
|
||||
<span slot="headerTitle">${heading}</span>
|
||||
<ha-icon-button
|
||||
slot="headerActionItems"
|
||||
class="enlarge"
|
||||
.path=${this.large ? mdiFullscreenExit : mdiFullscreen}
|
||||
.label=${this.hass.localize(
|
||||
this.large
|
||||
? "ui.panel.lovelace.editor.edit_card.shrink"
|
||||
: "ui.panel.lovelace.editor.edit_card.enlarge"
|
||||
)}
|
||||
@click=${this._toggleLarge}
|
||||
></ha-icon-button>
|
||||
<span
|
||||
slot="headerTitle"
|
||||
class="title-enlargeable"
|
||||
@click=${this._enlarge}
|
||||
>${heading}</span
|
||||
>
|
||||
${
|
||||
this._documentationURL !== undefined
|
||||
? html`
|
||||
@@ -345,14 +330,10 @@ export class HuiDialogEditCard
|
||||
`;
|
||||
}
|
||||
|
||||
private _toggleLarge() {
|
||||
this._animateWidth = true;
|
||||
this.large = !this.large;
|
||||
}
|
||||
|
||||
// The code editor's fullscreen changes the height at once, so the width must not lag behind
|
||||
private _stopWidthAnimation() {
|
||||
this._animateWidth = false;
|
||||
private _enlarge() {
|
||||
withViewTransition(() => {
|
||||
this.large = !this.large;
|
||||
});
|
||||
}
|
||||
|
||||
private _ignoreKeydown(ev: KeyboardEvent) {
|
||||
@@ -595,18 +576,8 @@ export class HuiDialogEditCard
|
||||
ha-dialog ha-icon-button[slot="headerActionItems"] {
|
||||
color: var(--secondary-text-color);
|
||||
}
|
||||
ha-dialog.animate-width {
|
||||
--ha-dialog-width-transition:
|
||||
min-width var(--ha-animation-duration-normal) ease-out,
|
||||
max-width var(--ha-animation-duration-normal) ease-out;
|
||||
}
|
||||
ha-dialog[fullscreen] .enlarge {
|
||||
display: none;
|
||||
}
|
||||
@media (max-width: 999px) {
|
||||
.enlarge {
|
||||
display: none;
|
||||
}
|
||||
.title-enlargeable {
|
||||
display: block;
|
||||
}
|
||||
`,
|
||||
];
|
||||
|
||||
@@ -67,7 +67,6 @@ import { supportsTargetHumidityCardFeature } from "../../card-features/hui-targe
|
||||
import { supportsTargetTemperatureCardFeature } from "../../card-features/hui-target-temperature-card-feature";
|
||||
import { supportsTimerActionsCardFeature } from "../../card-features/hui-timer-actions-card-feature";
|
||||
import { supportsTimerPresetsCardFeature } from "../../card-features/hui-timer-presets-card-feature";
|
||||
import { supportsTimerProgressCardFeature } from "../../card-features/hui-timer-progress-card-feature";
|
||||
import { supportsToggleCardFeature } from "../../card-features/hui-toggle-card-feature";
|
||||
import { supportsTrendGraphCardFeature } from "../../card-features/hui-trend-graph-card-feature";
|
||||
import { supportsUpdateActionsCardFeature } from "../../card-features/hui-update-actions-card-feature";
|
||||
@@ -137,7 +136,6 @@ const UI_FEATURE_TYPES = [
|
||||
"temperature-forecast",
|
||||
"timer-actions",
|
||||
"timer-presets",
|
||||
"timer-progress",
|
||||
"toggle",
|
||||
"update-actions",
|
||||
"vacuum-commands",
|
||||
@@ -241,7 +239,6 @@ const SUPPORTS_FEATURE_TYPES: Record<
|
||||
"temperature-forecast": supportsTemperatureForecastCardFeature,
|
||||
"timer-actions": supportsTimerActionsCardFeature,
|
||||
"timer-presets": supportsTimerPresetsCardFeature,
|
||||
"timer-progress": supportsTimerProgressCardFeature,
|
||||
toggle: supportsToggleCardFeature,
|
||||
"update-actions": supportsUpdateActionsCardFeature,
|
||||
"vacuum-commands": supportsVacuumCommandsCardFeature,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type { PropertyValues } from "lit";
|
||||
import { LitElement, css, html, nothing } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators";
|
||||
import { live } from "lit/directives/live";
|
||||
import { debounce } from "../../../common/util/debounce";
|
||||
import "../../../components/ha-slider";
|
||||
import "../../../components/input/ha-input";
|
||||
@@ -89,7 +88,7 @@ class HuiNumberEntityRow extends LitElement implements LovelaceRow {
|
||||
.step=${Number(stateObj.attributes.step)}
|
||||
.min=${Number(stateObj.attributes.min)}
|
||||
.max=${Number(stateObj.attributes.max)}
|
||||
.value=${live(Number(stateObj.state))}
|
||||
.value=${Number(stateObj.state)}
|
||||
@change=${this._selectedValueChanged}
|
||||
></ha-slider>
|
||||
<span class="state">
|
||||
@@ -112,7 +111,7 @@ class HuiNumberEntityRow extends LitElement implements LovelaceRow {
|
||||
.step=${Number(stateObj.attributes.step)}
|
||||
.min=${Number(stateObj.attributes.min)}
|
||||
.max=${Number(stateObj.attributes.max)}
|
||||
.value=${live(Number(stateObj.state).toString())}
|
||||
.value=${Number(stateObj.state).toString()}
|
||||
type="number"
|
||||
@change=${this._selectedValueChanged}
|
||||
>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { PropertyValues } from "lit";
|
||||
import type { HASSDomEvent } from "../common/dom/fire_event";
|
||||
import { mainWindow } from "../common/dom/get_main_window";
|
||||
import { computeDomain } from "../common/entity/compute_domain";
|
||||
import { replaceCurrentUrl } from "../common/navigate";
|
||||
import {
|
||||
createMoreInfoUrl,
|
||||
@@ -11,6 +12,8 @@ import type { MoreInfoDialogParams } from "../dialogs/more-info/ha-more-info-dia
|
||||
import type { Constructor } from "../types";
|
||||
import type { HassBaseEl } from "./hass-base-mixin";
|
||||
|
||||
const LARGE_MORE_INFO_DOMAINS = ["camera", "image"];
|
||||
|
||||
declare global {
|
||||
// for fire event
|
||||
interface HASSDomEvents {
|
||||
@@ -44,7 +47,13 @@ export default <T extends Constructor<HassBaseEl>>(superClass: T) =>
|
||||
{
|
||||
entityId: ev.detail.entityId,
|
||||
view,
|
||||
large: ev.detail.large,
|
||||
large:
|
||||
ev.detail.large ??
|
||||
(ev.detail.entityId
|
||||
? LARGE_MORE_INFO_DOMAINS.includes(
|
||||
computeDomain(ev.detail.entityId)
|
||||
)
|
||||
: false),
|
||||
data: ev.detail.data,
|
||||
returnUrl,
|
||||
},
|
||||
|
||||
@@ -10952,8 +10952,6 @@
|
||||
"pick_card": "Add to dashboard",
|
||||
"pick_card_title": "Which card would you like to add to {name}",
|
||||
"toggle_editor": "Toggle editor",
|
||||
"enlarge": "Enlarge",
|
||||
"shrink": "Shrink",
|
||||
"unsaved_changes": "You have unsaved changes",
|
||||
"confirm_cancel": "Are you sure you want to cancel?",
|
||||
"show_visual_editor": "Show visual editor",
|
||||
@@ -11002,8 +11000,6 @@
|
||||
"pick_badge": "Which badge would you like to add?",
|
||||
"pick_badge_title": "Which badge would you like to add to \"{name}\"?",
|
||||
"toggle_editor": "[%key:ui::panel::lovelace::editor::edit_card::toggle_editor%]",
|
||||
"enlarge": "[%key:ui::panel::lovelace::editor::edit_card::enlarge%]",
|
||||
"shrink": "[%key:ui::panel::lovelace::editor::edit_card::shrink%]",
|
||||
"unsaved_changes": "[%key:ui::panel::lovelace::editor::edit_card::unsaved_changes%]",
|
||||
"confirm_cancel": "[%key:ui::panel::lovelace::editor::edit_card::confirm_cancel%]",
|
||||
"show_visual_editor": "[%key:ui::panel::lovelace::editor::edit_card::show_visual_editor%]",
|
||||
@@ -12454,9 +12450,6 @@
|
||||
"dropdown": "[%key:ui::panel::lovelace::editor::features::types::climate-preset-modes::style_list::dropdown%]"
|
||||
}
|
||||
},
|
||||
"timer-progress": {
|
||||
"label": "Timer progress"
|
||||
},
|
||||
"fan-preset-modes": {
|
||||
"label": "Fan preset modes",
|
||||
"style": "[%key:ui::panel::lovelace::editor::features::types::climate-preset-modes::style%]",
|
||||
|
||||
@@ -177,7 +177,6 @@ exports[`generateStatisticsChartData > matches snapshot for a bar chart with sum
|
||||
"datasets": [
|
||||
{
|
||||
"animationDurationUpdate": 0,
|
||||
"barMaxWidth": 50,
|
||||
"color": "#4269d07F",
|
||||
"cursor": "default",
|
||||
"data": [
|
||||
@@ -348,7 +347,6 @@ exports[`generateStatisticsChartData > matches snapshot for a bar chart with sum
|
||||
},
|
||||
{
|
||||
"animationDurationUpdate": 0,
|
||||
"barMaxWidth": 50,
|
||||
"color": "#f4bd4a7F",
|
||||
"cursor": "default",
|
||||
"data": [
|
||||
@@ -1382,7 +1380,6 @@ exports[`generateStatisticsChartData > matches snapshot for a stacked bar chart
|
||||
"datasets": [
|
||||
{
|
||||
"animationDurationUpdate": 0,
|
||||
"barMaxWidth": 50,
|
||||
"color": "#4269d07F",
|
||||
"cursor": "default",
|
||||
"data": [
|
||||
@@ -1447,7 +1444,6 @@ exports[`generateStatisticsChartData > matches snapshot for a stacked bar chart
|
||||
},
|
||||
{
|
||||
"animationDurationUpdate": 0,
|
||||
"barMaxWidth": 50,
|
||||
"color": "#f4bd4a7F",
|
||||
"cursor": "default",
|
||||
"data": [
|
||||
|
||||
Reference in new issue
Block a user