Compare commits

..
Author SHA1 Message Date
Felipe Santos f2b2c92bdd Keep the whole dependents warning inside its plural (#56295) 2026-11-30 19:50:04 +01:00
renovate[bot] 33ef19dac1 Update dependency eslint to v10.16.0 (#56297)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-30 20:35:43 +02:00
Bram KragtenandClaude Opus 5.5 1e797c345c Fix the remote access card title and the webhooks help link (#56290)
Fix remote access card title and webhooks help link

The remote access card used "Remote connection" while its page, the
overview row and onboarding all say "Remote access". Use the page title
for the card and its switch, and drop the unused string.

The webhooks "Learn more" link pointed to nabucasa.com/config/webhooks
without a trailing slash, which returns a 404. Only the form with the
slash redirects to the support article, like the other Nabu Casa links.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-30 18:46:11 +01:00
Aidan Timson 9083641ae7 Let custom cards subscribe to visibility conditions (#56284)
* Let custom cards subscribe to visibility on any page

* Send the context entity to core-evaluated conditions
2026-11-30 18:12:32 +02:00
Rodrigo Roque 5fc4ad4e0c Highlight sidebar panels whose url_path has several segments (#56144) 2026-11-30 15:18:20 +00:00
Marcin BauerandClaude Fable 5.2 ba33d2897b Replace brand titles in All brands with the brand name on each card (#56262)
Co-authored-by: Claude Fable 5.2 <[email protected]>
2026-11-30 16:15:58 +01:00
Christian Wiedel 9484d51694 Flip dropdown menus away from safe areas (#56167)
Pass the safe-area insets to the popup's flip padding, so menus open on
the side with room instead of being squeezed against a navigation bar,
notch or home indicator.
2026-11-30 16:07:04 +01:00
Felipe Santos 55739f2666 Show which integrations use an integration and warn before deleting it (#56188) 2026-11-30 16:01:26 +01:00
Paul Bottein 483b8d1c76 Keep the camera stream details in sync with the player (#56286) 2026-11-30 15:50:41 +01:00
renovate[bot] f589ae2113 Update dependency maplibre-gl to v6.20.0 (#56281)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-30 15:36:06 +01:00
Maarten Lakerveld 1c01df1d6c Center cropped entity pictures in map markers (#56283)
Non-square entity pictures, such as the 16:9 vehicle renders from the
Skoda integration, were cropped from the top-left corner because the
marker background had no position set.
2026-11-30 14:33:21 +00:00
WendelinandClaude Opus 5.5 3216ebc19a Keep MJPEG picture in picture updating in Firefox (#56282)
Firefox only draws the first frame of an MJPEG image into a canvas, so
the picture in picture video froze. A bitmap of the image has the
current frame.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-30 16:27:08 +02:00
27 changed files with 575 additions and 276 deletions

No files matched your search

@@ -632,10 +632,6 @@ const SCHEMAS: {
},
language: { name: "Language", selector: { language: {} } },
navigation: { name: "Navigation", selector: { navigation: {} } },
ui_condition: {
name: "Dashboard conditions",
selector: { ui_condition: {} },
},
numeric_threshold: {
name: "Numeric threshold",
selector: { numeric_threshold: {} },
+2 -2
View File
@@ -108,7 +108,7 @@
"leaflet.markercluster": "1.5.3",
"lit": "3.3.3",
"lit-html": "3.3.3",
"maplibre-gl": "6.19.0",
"maplibre-gl": "6.20.0",
"marked": "18.3.0",
"memoize-one": "7.0.0",
"nanoid": "6.0.2",
@@ -177,7 +177,7 @@
"browserslist-useragent-regexp": "4.1.4",
"core-js-compat": "3.51.0",
"del": "9.0.1",
"eslint": "10.15.0",
"eslint": "10.16.0",
"eslint-config-prettier": "10.1.9",
"eslint-import-resolver-webpack": "0.13.11",
"eslint-plugin-import-x": "4.18.1",
+85 -92
View File
@@ -296,7 +296,7 @@ importers:
version: 1.0.3
'@maplibre/maplibre-gl-leaflet':
specifier: 0.1.4
version: 0.1.4(@types/[email protected])([email protected])(maplibre-gl@6.19.0)
version: 0.1.4(@types/[email protected])([email protected])(maplibre-gl@6.20.0)
'@mdi/js':
specifier: 7.4.47
version: 7.4.47
@@ -317,7 +317,7 @@ importers:
version: 4.5.4
'@versatiles/style':
specifier: 9.1.3
version: 9.1.3(maplibre-gl@6.19.0)
version: 9.1.3(maplibre-gl@6.20.0)
'@vibrant/color':
specifier: 4.0.4
version: 4.0.4
@@ -403,8 +403,8 @@ importers:
specifier: 3.3.3
version: 3.3.3
maplibre-gl:
specifier: 6.19.0
version: 6.19.0
specifier: 6.20.0
version: 6.20.0
marked:
specifier: 18.3.0
version: 18.3.0
@@ -507,7 +507,7 @@ importers:
version: 4.23.1([email protected])
'@eslint/js':
specifier: 10.0.1
version: 10.0.1([email protected]5.0([email protected]))
version: 10.0.1([email protected]6.0([email protected]))
'@gfx/zopfli':
specifier: 1.0.15
version: 1.0.15
@@ -516,7 +516,7 @@ importers:
version: link:packages/components
'@html-eslint/eslint-plugin':
specifier: 0.69.0
version: 0.69.0([email protected]5.0([email protected]))
version: 0.69.0([email protected]6.0([email protected]))
'@lokalise/node-api':
specifier: 17.0.1
version: 17.0.1
@@ -605,29 +605,29 @@ importers:
specifier: 9.0.1
version: 9.0.1
eslint:
specifier: 10.15.0
version: 10.15.0([email protected])
specifier: 10.16.0
version: 10.16.0([email protected])
eslint-config-prettier:
specifier: 10.1.9
version: 10.1.9([email protected]5.0([email protected]))
version: 10.1.9([email protected]6.0([email protected]))
eslint-import-resolver-webpack:
specifier: 0.13.11
version: 0.13.11([email protected])
eslint-plugin-import-x:
specifier: 4.18.1
version: 4.18.1(@typescript-eslint/[email protected]([email protected]5.0([email protected]))([email protected])([email protected])([email protected]))([email protected]5.0([email protected]))([email protected])
version: 4.18.1(@typescript-eslint/[email protected]([email protected]6.0([email protected]))([email protected])([email protected])([email protected]))([email protected]6.0([email protected]))([email protected])
eslint-plugin-lit:
specifier: 2.3.1
version: 2.3.1([email protected]5.0([email protected]))
version: 2.3.1([email protected]6.0([email protected]))
eslint-plugin-lit-a11y:
specifier: 5.1.3
version: 5.1.3([email protected]5.0([email protected]))
version: 5.1.3([email protected]6.0([email protected]))
eslint-plugin-unused-imports:
specifier: 4.4.1
version: 4.4.1(@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected]5.0([email protected]))([email protected])([email protected])([email protected]))([email protected]5.0([email protected]))([email protected])([email protected])([email protected]))([email protected]5.0([email protected]))
version: 4.4.1(@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected]6.0([email protected]))([email protected])([email protected])([email protected]))([email protected]6.0([email protected]))([email protected])([email protected])([email protected]))([email protected]6.0([email protected]))
eslint-plugin-wc:
specifier: 3.1.0
version: 3.1.0([email protected]5.0([email protected]))
version: 3.1.0([email protected]6.0([email protected]))
fancy-log:
specifier: 2.0.0
version: 2.0.0
@@ -717,7 +717,7 @@ importers:
version: 6.0.3
typescript-eslint:
specifier: 8.74.0
version: 8.74.0([email protected]5.0([email protected]))([email protected])([email protected])([email protected])
version: 8.74.0([email protected]6.0([email protected]))([email protected])([email protected])([email protected])
vite:
specifier: 8.4.0
version: 8.4.0(@types/[email protected])([email protected])([email protected])
@@ -1914,8 +1914,8 @@ packages:
resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==}
engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
'@eslint/[email protected].6':
resolution: {integrity: sha512-WrTH7nioI9QPY4NZGnsywmecswJdgeq4BCM76qok9VgjTO29ZgUzUvcuJLVPYVQM4uDbaPBU0M33R9DIxI8X3w==}
'@eslint/[email protected].7':
resolution: {integrity: sha512-Ix1tmZjA7/OmE7ROAfORe83hVnqlDzLpZVHFjHQt5mvLm1U03qMexpaxKqFIL362QV32SoPaZqmKQr3tdqFY2w==}
engines: {node: ^20.19.0 || ^22.13.0 || >=24}
'@eslint/[email protected]':
@@ -2287,8 +2287,8 @@ packages:
'@mapbox/[email protected]':
resolution: {integrity: sha512-Qf10S1uIHMk20ri/IVBnpS+esUEkVaR5Hftmz88jTInrpmWgPGJfPe3LVjjlE77trLx8tH6qjTG7uWH9hIq/0Q==}
'@maplibre/geojson-vt@6.3.2':
resolution: {integrity: sha512-7WFEEkeEjg2foQleJOYl7e2ldi4ZiXp8XV2ibqyquFAA/4iaJgtdEKBrfEpPPVem/VkXS1OXqZsHl6V/MwQYeQ==}
'@maplibre/geojson-vt@7.0.1':
resolution: {integrity: sha512-xq3+TiG4hZtx9lHjq/oZginEBtJLJTJqRVmEIhPDSznlkl231z/p4foorEqASpD233EHO9+GVnnu6GNA4Pl+YQ==}
'@maplibre/[email protected]':
resolution: {integrity: sha512-k57wcndZIvq3m08g2je4pjUPGr43ffNW3j+gXbymt8Vi2l1lUERUi1UmdTZcTPN8LuDDYOMWRNBaSLwpAu02ew==}
@@ -2297,8 +2297,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.11.0':
resolution: {integrity: sha512-MQMBqOkmVm7fLLun2l/bwOv9bURkvyEVISo/OYleb9/nsnfjQ6gs29isysARt5FK/k9RFM4SmH4eMTUQGlv0Pw==}
hasBin: true
'@maplibre/[email protected]':
@@ -5115,8 +5115,8 @@ packages:
resolution: {integrity: sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==}
engines: {node: ^20.19.0 || ^22.13.0 || >=24}
[email protected]5.0:
resolution: {integrity: sha512-+5Wg4p+ze3sG1WErYgUO/3H1IQIfFBymVUA0Fo/XTeBOLS6UQIUekpSJ8sdRkn7O7wjh84b55w/roqavH2aScg==}
[email protected]6.0:
resolution: {integrity: sha512-Xu3PRLG/wCaZWZ20gkExUcNqL2mWWsXTR+Lln3Sof4Y9WuA678fH9hrlQ8B6UNwbTnsKdDdBYOd2jxtycXVTGQ==}
engines: {node: ^20.19.0 || ^22.13.0 || >=24}
hasBin: true
peerDependencies:
@@ -6216,8 +6216,8 @@ packages:
[email protected]:
resolution: {integrity: sha512-C0X0KQmGm3N2ftbTGBhSyuydQ+vV1LC3f3zPvT3RXHXNZrvfPZcoXp/N5DOa8vedX/rTMm2CjTtivFg2STJMRQ==}
maplibre-gl@6.19.0:
resolution: {integrity: sha512-3bOrnfddggUYudLGJFsYFvqulUyvSxy4iQzd/uURI7ZhgYEZifdSrECujRSghaCpc+v/ZsFI0Y6ZsGSilEtE+w==}
maplibre-gl@6.20.0:
resolution: {integrity: sha512-7manvqXeNoN0mKRzenYDopkb3VW9j7iag45RvopkOVFZ7c+La7CBWtK8eBS5bKrI6NyxqAIxPxIG1PMcotcY1w==}
engines: {node: '>=16.14.0', npm: '>=8.1.0'}
[email protected]:
@@ -6717,8 +6717,8 @@ packages:
resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}
engines: {node: '>=8'}
pbf@5.1.2:
resolution: {integrity: sha512-mnvGdvOrIvJOBGUEdGkrVXjN8E/VkIJCkf2eS1DH2yv82ORUlLttmDt0rWY38yYZmVwciZwBUvHM20qxBZf40w==}
pbf@5.2.0:
resolution: {integrity: sha512-R6YptaRZl0t9SVO6MllszYq1IkaOQawzprndmvQxEoFrtvX7fT+oNIPoVD152NOllmLWEC3ThxzUTqBX12q5FQ==}
hasBin: true
[email protected]:
@@ -6994,9 +6994,6 @@ packages:
[email protected]:
resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==}
[email protected]:
resolution: {integrity: sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==}
[email protected]:
resolution: {integrity: sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==}
engines: {node: '>= 0.4'}
@@ -9760,14 +9757,14 @@ snapshots:
tslib: 2.9.1
optional: true
'@eslint-community/[email protected]([email protected]5.0([email protected]))':
'@eslint-community/[email protected]([email protected]6.0([email protected]))':
dependencies:
eslint: 10.15.0([email protected])
eslint: 10.16.0([email protected])
eslint-visitor-keys: 3.4.3
'@eslint-community/[email protected]': {}
'@eslint/[email protected].6([email protected])':
'@eslint/[email protected].7([email protected])':
dependencies:
'@eslint/object-schema': 3.0.5
debug: 4.4.3([email protected])
@@ -9787,9 +9784,9 @@ snapshots:
dependencies:
'@types/json-schema': 7.0.15
'@eslint/[email protected]([email protected]5.0([email protected]))':
'@eslint/[email protected]([email protected]6.0([email protected]))':
optionalDependencies:
eslint: 10.15.0([email protected])
eslint: 10.16.0([email protected])
'@eslint/[email protected]': {}
@@ -9956,7 +9953,7 @@ snapshots:
'@html-eslint/types': 0.69.0
html-standard: 0.0.14
'@html-eslint/[email protected]([email protected]5.0([email protected]))':
'@html-eslint/[email protected]([email protected]6.0([email protected]))':
dependencies:
'@eslint/plugin-kit': 0.4.1
'@html-eslint/core': 0.69.0
@@ -9965,7 +9962,7 @@ snapshots:
'@html-eslint/template-syntax-parser': 0.69.0
'@html-eslint/types': 0.69.0
'@rviscomi/capo.js': 2.2.1
eslint: 10.15.0([email protected])
eslint: 10.16.0([email protected])
html-standard: 0.0.14
'@html-eslint/[email protected]':
@@ -10228,19 +10225,19 @@ snapshots:
dependencies:
'@mapbox/point-geometry': 1.1.0
'@types/geojson': 7946.0.16
pbf: 5.1.2
pbf: 5.2.0
'@maplibre/geojson-vt@6.3.2':
'@maplibre/geojson-vt@7.0.1':
dependencies:
kdbush: 4.1.0
'@maplibre/[email protected](@types/[email protected])([email protected])(maplibre-gl@6.19.0)':
'@maplibre/[email protected](@types/[email protected])([email protected])(maplibre-gl@6.20.0)':
dependencies:
'@types/leaflet': 1.9.23
leaflet: 1.9.4
maplibre-gl: 6.19.0
maplibre-gl: 6.20.0
'@maplibre/maplibre-gl-style-spec@26.9.0':
'@maplibre/maplibre-gl-style-spec@26.11.0':
dependencies:
'@mapbox/jsonlint-lines-primitives': 2.0.3
'@mapbox/unitbezier': 1.0.0
@@ -10257,7 +10254,7 @@ snapshots:
dependencies:
'@mapbox/point-geometry': 1.1.0
'@types/geojson': 7946.0.16
pbf: 5.1.2
pbf: 5.2.0
'@marijn/[email protected]': {}
@@ -11531,15 +11528,15 @@ snapshots:
dependencies:
'@types/node': 24.19.4
'@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected]5.0([email protected]))([email protected])([email protected])([email protected]))([email protected]5.0([email protected]))([email protected])([email protected])([email protected])':
'@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected]6.0([email protected]))([email protected])([email protected])([email protected]))([email protected]6.0([email protected]))([email protected])([email protected])([email protected])':
dependencies:
'@eslint-community/regexpp': 4.12.2
'@typescript-eslint/parser': 8.74.0([email protected]5.0([email protected]))([email protected])([email protected])([email protected])
'@typescript-eslint/parser': 8.74.0([email protected]6.0([email protected]))([email protected])([email protected])([email protected])
'@typescript-eslint/scope-manager': 8.74.0
'@typescript-eslint/type-utils': 8.74.0([email protected]5.0([email protected]))([email protected])([email protected])([email protected])
'@typescript-eslint/utils': 8.74.0([email protected]5.0([email protected]))([email protected])([email protected])([email protected])
'@typescript-eslint/type-utils': 8.74.0([email protected]6.0([email protected]))([email protected])([email protected])([email protected])
'@typescript-eslint/utils': 8.74.0([email protected]6.0([email protected]))([email protected])([email protected])([email protected])
'@typescript-eslint/visitor-keys': 8.74.0
eslint: 10.15.0([email protected])
eslint: 10.16.0([email protected])
ignore: 7.0.6
natural-compare: 1.4.0
ts-api-utils: 2.5.0([email protected])
@@ -11548,14 +11545,14 @@ snapshots:
- '@typescript/native'
- supports-color
'@typescript-eslint/[email protected]([email protected]5.0([email protected]))([email protected])([email protected])([email protected])':
'@typescript-eslint/[email protected]([email protected]6.0([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
debug: 4.4.3([email protected])
eslint: 10.15.0([email protected])
eslint: 10.16.0([email protected])
typescript: 6.0.3
transitivePeerDependencies:
- '@typescript/native'
@@ -11579,13 +11576,13 @@ snapshots:
dependencies:
typescript: 6.0.3
'@typescript-eslint/[email protected]([email protected]5.0([email protected]))([email protected])([email protected])([email protected])':
'@typescript-eslint/[email protected]([email protected]6.0([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]5.0([email protected]))([email protected])([email protected])([email protected])
'@typescript-eslint/utils': 8.74.0([email protected]6.0([email protected]))([email protected])([email protected])([email protected])
debug: 4.4.3([email protected])
eslint: 10.15.0([email protected])
eslint: 10.16.0([email protected])
ts-api-utils: 2.5.0([email protected])
typescript: 6.0.3
transitivePeerDependencies:
@@ -11611,13 +11608,13 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@typescript-eslint/[email protected]([email protected]5.0([email protected]))([email protected])([email protected])([email protected])':
'@typescript-eslint/[email protected]([email protected]6.0([email protected]))([email protected])([email protected])([email protected])':
dependencies:
'@eslint-community/eslint-utils': 4.10.1([email protected]5.0([email protected]))
'@eslint-community/eslint-utils': 4.10.1([email protected]6.0([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])
eslint: 10.15.0([email protected])
eslint: 10.16.0([email protected])
typescript: 6.0.3
transitivePeerDependencies:
- '@typescript/native'
@@ -11758,11 +11755,11 @@ snapshots:
'@unrs/[email protected]':
optional: true
'@versatiles/[email protected](maplibre-gl@6.19.0)':
'@versatiles/[email protected](maplibre-gl@6.20.0)':
dependencies:
'@maplibre/maplibre-gl-style-spec': 26.9.0
'@maplibre/maplibre-gl-style-spec': 26.11.0
optionalDependencies:
maplibre-gl: 6.19.0
maplibre-gl: 6.20.0
'@vibrant/[email protected]': {}
@@ -12932,9 +12929,9 @@ snapshots:
[email protected]: {}
[email protected]([email protected]5.0([email protected])):
[email protected]([email protected]6.0([email protected])):
dependencies:
eslint: 10.15.0([email protected])
eslint: 10.16.0([email protected])
[email protected]([email protected]):
dependencies:
@@ -12958,14 +12955,14 @@ snapshots:
transitivePeerDependencies:
- supports-color
[email protected](@typescript-eslint/[email protected]([email protected]5.0([email protected]))([email protected])([email protected])([email protected]))([email protected]5.0([email protected]))([email protected]):
[email protected](@typescript-eslint/[email protected]([email protected]6.0([email protected]))([email protected])([email protected])([email protected]))([email protected]6.0([email protected]))([email protected]):
dependencies:
'@typescript-eslint/types': 8.74.0
cjs-module-lexer: 2.3.0
comment-parser: 1.4.8
debug: 4.4.3([email protected])
es-module-lexer: 3.0.4
eslint: 10.15.0([email protected])
eslint: 10.16.0([email protected])
eslint-import-context: 0.1.9([email protected])
is-glob: 4.0.3
minimatch: 11.0.5
@@ -12973,39 +12970,39 @@ snapshots:
stable-hash-x: 0.2.0
unrs-resolver: 1.12.2
optionalDependencies:
'@typescript-eslint/utils': 8.74.0([email protected]5.0([email protected]))([email protected])([email protected])([email protected])
'@typescript-eslint/utils': 8.74.0([email protected]6.0([email protected]))([email protected])([email protected])([email protected])
transitivePeerDependencies:
- supports-color
[email protected]([email protected]5.0([email protected])):
[email protected]([email protected]6.0([email protected])):
dependencies:
'@thepassle/axobject-query': 4.0.0
aria-query: 5.3.2
axe-core: 4.13.0
dom5: 3.0.1
emoji-regex: 10.6.0
eslint: 10.15.0([email protected])
eslint-plugin-lit: 2.3.1([email protected]5.0([email protected]))
eslint: 10.16.0([email protected])
eslint-plugin-lit: 2.3.1([email protected]6.0([email protected]))
eslint-rule-extender: 0.0.1
language-tags: 1.0.9
parse5: 7.3.0
parse5-htmlparser2-tree-adapter: 6.0.1
[email protected]([email protected]5.0([email protected])):
[email protected]([email protected]6.0([email protected])):
dependencies:
eslint: 10.15.0([email protected])
eslint: 10.16.0([email protected])
parse5: 8.1.0
parse5-htmlparser2-tree-adapter: 8.0.1
[email protected](@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected]5.0([email protected]))([email protected])([email protected])([email protected]))([email protected]5.0([email protected]))([email protected])([email protected])([email protected]))([email protected]5.0([email protected])):
[email protected](@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected]6.0([email protected]))([email protected])([email protected])([email protected]))([email protected]6.0([email protected]))([email protected])([email protected])([email protected]))([email protected]6.0([email protected])):
dependencies:
eslint: 10.15.0([email protected])
eslint: 10.16.0([email protected])
optionalDependencies:
'@typescript-eslint/eslint-plugin': 8.74.0(@typescript-eslint/[email protected]([email protected]5.0([email protected]))([email protected])([email protected])([email protected]))([email protected]5.0([email protected]))([email protected])([email protected])([email protected])
'@typescript-eslint/eslint-plugin': 8.74.0(@typescript-eslint/[email protected]([email protected]6.0([email protected]))([email protected])([email protected])([email protected]))([email protected]6.0([email protected]))([email protected])([email protected])([email protected])
[email protected]([email protected]5.0([email protected])):
[email protected]([email protected]6.0([email protected])):
dependencies:
eslint: 10.15.0([email protected])
eslint: 10.16.0([email protected])
is-valid-element-name: 1.0.0
js-levenshtein-esm: 2.0.0
@@ -13022,11 +13019,11 @@ snapshots:
[email protected]: {}
[email protected]5.0([email protected]):
[email protected]6.0([email protected]):
dependencies:
'@eslint-community/eslint-utils': 4.10.1([email protected]5.0([email protected]))
'@eslint-community/eslint-utils': 4.10.1([email protected]6.0([email protected]))
'@eslint-community/regexpp': 4.12.2
'@eslint/config-array': 0.23.6([email protected])
'@eslint/config-array': 0.23.7([email protected])
'@eslint/config-helpers': 0.7.0
'@eslint/core': 1.2.1
'@eslint/plugin-kit': 0.7.3
@@ -14231,14 +14228,14 @@ snapshots:
[email protected]: {}
maplibre-gl@6.19.0:
maplibre-gl@6.20.0:
dependencies:
'@mapbox/point-geometry': 1.1.0
'@mapbox/tiny-sdf': 2.3.0
'@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/geojson-vt': 7.0.1
'@maplibre/maplibre-gl-style-spec': 26.11.0
'@maplibre/mlt': 1.3.0
'@maplibre/vt-pbf': 4.3.3
'@types/geojson': 7946.0.16
@@ -14247,7 +14244,7 @@ snapshots:
gl-matrix: 3.4.4
kdbush: 4.1.0
murmurhash-js: 1.0.0
pbf: 5.1.2
pbf: 5.2.0
potpack: 2.1.0
quickselect: 3.0.0
tinyqueue: 3.0.0
@@ -14825,9 +14822,9 @@ snapshots:
[email protected]: {}
pbf@5.1.2:
pbf@5.2.0:
dependencies:
resolve-protobuf-schema: 2.1.0
protocol-buffers-schema: 3.6.1
[email protected]: {}
@@ -15057,10 +15054,6 @@ snapshots:
[email protected]: {}
[email protected]:
dependencies:
protocol-buffers-schema: 3.6.1
[email protected]:
dependencies:
es-errors: 1.3.0
@@ -15837,13 +15830,13 @@ snapshots:
possible-typed-array-names: 1.1.0
reflect.getprototypeof: 1.0.10
[email protected]([email protected]5.0([email protected]))([email protected])([email protected])([email protected]):
[email protected]([email protected]6.0([email protected]))([email protected])([email protected])([email protected]):
dependencies:
'@typescript-eslint/eslint-plugin': 8.74.0(@typescript-eslint/[email protected]([email protected]5.0([email protected]))([email protected])([email protected])([email protected]))([email protected]5.0([email protected]))([email protected])([email protected])([email protected])
'@typescript-eslint/parser': 8.74.0([email protected]5.0([email protected]))([email protected])([email protected])([email protected])
'@typescript-eslint/eslint-plugin': 8.74.0(@typescript-eslint/[email protected]([email protected]6.0([email protected]))([email protected])([email protected])([email protected]))([email protected]6.0([email protected]))([email protected])([email protected])([email protected])
'@typescript-eslint/parser': 8.74.0([email protected]6.0([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]5.0([email protected]))([email protected])([email protected])([email protected])
eslint: 10.15.0([email protected])
'@typescript-eslint/utils': 8.74.0([email protected]6.0([email protected]))([email protected])([email protected])([email protected])
eslint: 10.16.0([email protected])
typescript: 6.0.3
transitivePeerDependencies:
- '@typescript/native'
@@ -0,0 +1,74 @@
import type { ReactiveControllerHost } from "@lit/reactive-element/reactive-controller";
import type {
ConditionContext,
VisibilityCondition,
} from "../../panels/lovelace/common/validate-condition";
import { addEntityToCondition } from "../../panels/lovelace/common/validate-condition";
import type { HomeAssistant } from "../../types";
import type { ConditionEvaluation } from "../controllers/condition-evaluator-controller";
import { ConditionEvaluatorController } from "../controllers/condition-evaluator-controller";
import { dropInvalidConditions } from "./sanitize";
export interface VisibilitySubscription {
/** Pass each new hass object so client-side conditions check again. */
update(hass: HomeAssistant): void;
/** Close the subscriptions. `onChange` is not called again. */
unsubscribe(): void;
}
/**
* Live visibility of a list of dashboard visibility conditions, for code
* without a Lit host, such as custom cards and plugins. Conditions core
* evaluates are subscribed to; the rest are checked locally. Reports
* `unknown` until core replies.
*/
export const subscribeVisibility = (
hass: HomeAssistant,
conditions: VisibilityCondition[],
onChange: (result: ConditionEvaluation, error?: string) => void,
context: ConditionContext = {}
): VisibilitySubscription => {
// The controller only needs a host to register with and to re-render.
const host: ReactiveControllerHost = {
addController: () => undefined,
removeController: () => undefined,
requestUpdate: () => undefined,
updateComplete: Promise.resolve(true),
};
let active = true;
const controller = new ConditionEvaluatorController(host, {
resubscribeDelay: 0,
onResult: (result, error) => {
if (active) {
onChange(result, error);
}
},
});
const sanitized = dropInvalidConditions(conditions);
const { entity_id: entityId } = context;
// Core-evaluated conditions never see the context, so fold its entity in
// first, as the dashboard mixin does.
const validConditions = entityId
? sanitized.map((condition) => addEntityToCondition(condition, entityId))
: sanitized;
const getContext = () => context;
controller.hostConnected();
controller.observe(validConditions, hass, getContext);
return {
update: (newHass) => {
if (active) {
controller.observe(validConditions, newHass, getContext);
}
},
unsubscribe: () => {
active = false;
controller.hostDisconnected();
},
};
};
+29 -3
View File
@@ -22,7 +22,10 @@ import type { LocalizeFunc } from "../../common/translations/localize";
import { nextRender } from "../../common/util/render-status";
import type { CameraCapabilities, CameraEntity } from "../../data/camera";
import type { CameraStreamStatus } from "../../data/camera-streams";
import { showCameraStreamInfoDialog } from "../../dialogs/camera/show-dialog-camera-stream-info";
import {
showCameraStreamInfoDialog,
type CameraStreamInfo,
} from "../../dialogs/camera/show-dialog-camera-stream-info";
import "../ha-camera-stream";
import type { HaCameraStream } from "../ha-camera-stream";
import "../ha-icon-button";
@@ -108,6 +111,8 @@ export class HaCameraPlayer extends LitElement {
@state() private _capabilities?: CameraCapabilities;
private _streamInfoCallbacks = new Set<(info: CameraStreamInfo) => void>();
@state() private _video?: HTMLVideoElement;
@state() private _muted = false;
@@ -213,6 +218,7 @@ export class HaCameraPlayer extends LitElement {
);
clearTimeout(this._controlsTimeout);
clearTimeout(this._wheelHintTimeout);
this._streamInfoCallbacks.clear();
this._unbindVideo(this._video);
this._video = undefined;
this._pointers.clear();
@@ -252,6 +258,10 @@ export class HaCameraPlayer extends LitElement {
this._unbindVideo(changedProps.get("_video") as HTMLVideoElement);
this._bindVideo(this._video);
}
if (changedProps.has("_status") || changedProps.has("_capabilities")) {
const info = this._streamInfo();
this._streamInfoCallbacks.forEach((callback) => callback(info));
}
}
protected render() {
@@ -602,10 +612,26 @@ export class HaCameraPlayer extends LitElement {
this._posterSize = ev.detail.size;
}
private _showStreamInfo() {
showCameraStreamInfoDialog(this, {
private _streamInfo(): CameraStreamInfo {
return {
status: this._status,
supportedTypes: this._capabilities?.frontend_stream_types,
};
}
private _subscribeStreamInfo = (
callback: (info: CameraStreamInfo) => void
) => {
this._streamInfoCallbacks.add(callback);
callback(this._streamInfo());
return () => {
this._streamInfoCallbacks.delete(callback);
};
};
private _showStreamInfo() {
showCameraStreamInfoDialog(this, {
subscribe: this._subscribeStreamInfo,
});
}
+9
View File
@@ -73,6 +73,15 @@ export class HaDropdown extends Dropdown {
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/naming-convention
private override async showMenu() {
// Flip away from the safe areas instead of opening into them, where the
// max-height below would squeeze the menu.
const styles = getComputedStyle(this);
// @ts-ignore flipPadding is typed as a number, floating-ui accepts sides
this.popup.flipPadding = {
top: parseFloat(styles.getPropertyValue("--safe-area-inset-top")) || 0,
bottom:
parseFloat(styles.getPropertyValue("--safe-area-inset-bottom")) || 0,
};
// @ts-ignore
await super.showMenu();
const triggerElement = this.getTrigger();
@@ -83,7 +83,6 @@ const SELECTOR_FALLBACK_VALUES = {
ui_action: undefined,
ui_clock_date_format: undefined,
ui_color: undefined,
ui_condition: undefined,
ui_state_content: undefined,
ui_time_format: undefined,
unit_of_measurement: undefined,
@@ -118,7 +118,6 @@ const SELECTOR_INITIAL_VALUES = {
ui_action: undefined,
ui_clock_date_format: undefined,
ui_color: undefined,
ui_condition: () => [],
ui_state_content: undefined,
ui_time_format: undefined,
unit_of_measurement: undefined,
+30 -14
View File
@@ -42,6 +42,8 @@ export class HaMjpegPlayer extends LitElement {
private _drawInterval?: number;
private _copyingFrame = false;
/** The video for picture in picture, undefined when it can't be shown. */
public get videoElement(): HTMLVideoElement | undefined {
return this._canCopy ? this._videoEl : undefined;
@@ -66,12 +68,13 @@ export class HaMjpegPlayer extends LitElement {
}
try {
if (!this._stream) {
this._drawFrame();
// The canvas already has a frame from the copy test
this._copyFrame();
// Captures a frame whenever the canvas is drawn
this._stream = this._canvas!.captureStream();
video.srcObject = this._stream;
this._drawInterval = window.setInterval(
() => this._drawFrame(),
() => this._copyFrame(),
1000 / PICTURE_IN_PICTURE_FRAME_RATE
);
}
@@ -178,32 +181,45 @@ export class HaMjpegPlayer extends LitElement {
/** An image from another origin can't be copied out of a canvas. */
private _testCopy(): boolean {
const image = this._imageEl!;
try {
this._drawFrame();
this._canvas?.getContext("2d")?.getImageData(0, 0, 1, 1);
return Boolean(this._canvas);
this._drawFrame(image, image.naturalWidth, image.naturalHeight);
this._canvas!.getContext("2d")?.getImageData(0, 0, 1, 1);
return true;
} catch (_err: unknown) {
return false;
}
}
private _drawFrame() {
// Firefox only draws the first frame of an MJPEG image, a bitmap of it
// has the current one
private async _copyFrame() {
const image = this._imageEl;
if (!image?.naturalWidth) {
if (this._copyingFrame || !image?.naturalWidth) {
return;
}
this._copyingFrame = true;
try {
const bitmap = await createImageBitmap(image);
this._drawFrame(bitmap, bitmap.width, bitmap.height);
bitmap.close();
} catch (_err: unknown) {
// The stream is between frames or restarting, the next copy tries again
} finally {
this._copyingFrame = false;
}
}
private _drawFrame(frame: CanvasImageSource, width: number, height: number) {
if (!this._canvas) {
this._canvas = document.createElement("canvas");
}
const canvas = this._canvas;
if (
canvas.width !== image.naturalWidth ||
canvas.height !== image.naturalHeight
) {
canvas.width = image.naturalWidth;
canvas.height = image.naturalHeight;
if (canvas.width !== width || canvas.height !== height) {
canvas.width = width;
canvas.height = height;
}
canvas.getContext("2d")?.drawImage(image, 0, 0);
canvas.getContext("2d")?.drawImage(frame, 0, 0);
}
private _stopVideo = () => {
@@ -1,58 +0,0 @@
import { css, html, LitElement, nothing } from "lit";
import { customElement, property } from "lit/decorators";
import type { UiConditionSelector } from "../../data/selector";
import "../../panels/lovelace/editor/conditions/ha-card-conditions-editor";
import type { VisibilityCondition } from "../../panels/lovelace/common/validate-condition";
import type { HomeAssistant } from "../../types";
@customElement("ha-selector-ui_condition")
export class HaUiConditionSelector extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
@property({ attribute: false })
public selector!: UiConditionSelector;
@property({ attribute: false }) public value?: VisibilityCondition[];
@property() public label?: string;
@property({ type: Boolean, reflect: true }) public disabled = false;
protected firstUpdated() {
// The editor's labels come from the dashboard translations, which only
// load with a dashboard; this selector can show anywhere.
this.hass.loadFragmentTranslation("lovelace");
}
// The editor fires `value-changed` with the new list, which bubbles out
// as this selector's own change. It has no disabled state of its own, so
// `inert` keeps it from being focused or changed in a disabled form.
protected render() {
return html`
${this.label ? html`<label>${this.label}</label>` : nothing}
<ha-card-conditions-editor
.hass=${this.hass}
.conditions=${this.value ?? []}
?inert=${this.disabled}
></ha-card-conditions-editor>
`;
}
static styles = css`
label {
display: block;
margin-bottom: var(--ha-space-1);
font-weight: var(--ha-font-weight-medium);
color: var(--secondary-text-color);
}
:host([disabled]) ha-card-conditions-editor {
opacity: var(--light-disabled-opacity);
}
`;
}
declare global {
interface HTMLElementTagNameMap {
"ha-selector-ui_condition": HaUiConditionSelector;
}
}
@@ -69,7 +69,6 @@ const LOAD_ELEMENTS = {
ui_action: () => import("./ha-selector-ui-action"),
ui_clock_date_format: () => import("./ha-selector-ui-clock-date-format"),
ui_color: () => import("./ha-selector-ui-color"),
ui_condition: () => import("./ha-selector-ui-condition"),
ui_state_content: () => import("./ha-selector-ui-state-content"),
ui_time_format: () => import("./ha-selector-ui-time-format"),
unit_of_measurement: () => import("./ha-selector-unit-of-measurement"),
+47 -15
View File
@@ -23,6 +23,7 @@ import {
getPanelIcon,
getPanelIconPath,
getPanelTitle,
getSelectedPanelUrlPath,
} from "../data/panel";
import type { PersistentNotification } from "../data/persistent_notification";
import { subscribeNotifications } from "../data/persistent_notification";
@@ -231,12 +232,36 @@ class HaSidebar extends SubscribeMixin(ScrollableFadeMixin(LitElement)) {
return nothing;
}
const selectedPanel = this.hass.panelUrl;
// prettier-ignore
return html`
${this._renderHeader()}
${this._renderAllPanels(selectedPanel)}`;
${this._renderAllPanels()}`;
}
private _computeSidebarPanels(): [PanelInfo[], PanelInfo[]] | undefined {
if (!this._panelOrder || !this._hiddenPanels) {
return undefined;
}
return computePanels(
this.hass.panels,
getDefaultPanelUrlPath(this.hass),
this._panelOrder,
this._hiddenPanels,
this.hass.locale
);
}
private _computeSelectedPanel(
sidebarPanels: [PanelInfo[], PanelInfo[]] | undefined,
route: Route | undefined
): string {
if (!route) {
return this.hass.panelUrl;
}
const urlPaths = (sidebarPanels ?? [[], []])
.flat()
.map((panel) => panel.url_path);
return getSelectedPanelUrlPath(urlPaths, route.path);
}
protected shouldUpdate(changedProps: PropertyValues): boolean {
@@ -254,7 +279,20 @@ class HaSidebar extends SubscribeMixin(ScrollableFadeMixin(LitElement)) {
) {
return true;
}
if (!this.hass || !changedProps.has("hass")) {
if (!this.hass) {
return false;
}
if (changedProps.has("route")) {
const sidebarPanels = this._computeSidebarPanels();
const oldRoute = changedProps.get("route") as Route | undefined;
if (
this._computeSelectedPanel(sidebarPanels, oldRoute) !==
this._computeSelectedPanel(sidebarPanels, this.route)
) {
return true;
}
}
if (!changedProps.has("hass")) {
return false;
}
const oldHass = changedProps.get("hass") as HomeAssistant;
@@ -355,7 +393,9 @@ class HaSidebar extends SubscribeMixin(ScrollableFadeMixin(LitElement)) {
</div>`;
}
private _renderAllPanels(selectedPanel: string) {
private _renderAllPanels() {
const sidebarPanels = this._computeSidebarPanels();
const selectedPanel = this._computeSelectedPanel(sidebarPanels, this.route);
const renderList = (content, cls: string, scrollable: boolean) =>
html`<ha-list-nav
class=${classMap({
@@ -365,7 +405,7 @@ class HaSidebar extends SubscribeMixin(ScrollableFadeMixin(LitElement)) {
>${content}</ha-list-nav
>`;
if (!this._panelOrder || !this._hiddenPanels) {
if (!sidebarPanels) {
return html`<div class="panels-list">
<div class="wrapper">
${renderList(
@@ -390,15 +430,7 @@ class HaSidebar extends SubscribeMixin(ScrollableFadeMixin(LitElement)) {
</div>`;
}
const defaultPanel = getDefaultPanelUrlPath(this.hass);
const [beforeSpacer, afterSpacer] = computePanels(
this.hass.panels,
defaultPanel,
this._panelOrder,
this._hiddenPanels,
this.hass.locale
);
const [beforeSpacer, afterSpacer] = sidebarPanels;
// prettier-ignore
return html`<div class="panels-list">
+1
View File
@@ -200,6 +200,7 @@ class HaEntityMarker extends LitElement {
}
.entity-picture {
background-size: cover;
background-position: center;
height: 100%;
width: 100%;
}
+15
View File
@@ -196,6 +196,21 @@ export const getPanelIconPath = (panel: PanelInfo): string | undefined => {
export const FIXED_PANELS = [PROFILE_PANEL, "config", NOT_FOUND_PANEL];
// A panel's url_path can span several segments (e.g. "config/logs"), so the
// most specific url_path matching the path wins over its first segment.
export const getSelectedPanelUrlPath = (
urlPaths: string[],
path: string
): string =>
urlPaths.reduce(
(selected, urlPath) =>
urlPath.length > selected.length &&
(path === `/${urlPath}` || path.startsWith(`/${urlPath}/`))
? urlPath
: selected,
path.split("/")[1] ?? ""
);
export interface PanelMutableParams {
title?: string | null;
icon?: string | null;
-6
View File
@@ -89,7 +89,6 @@ export type Selector =
| UiActionSelector
| UiClockDateFormatSelector
| UiColorSelector
| UiConditionSelector
| UiStateContentSelector
| UiTimeFormatSelector
| UnitOfMeasurementSelector
@@ -204,11 +203,6 @@ export interface ConditionSelector {
} | null;
}
/** Dashboard conditions, edited like a card's visibility tab. */
export interface UiConditionSelector {
ui_condition: {} | null;
}
export interface ConversationAgentSelector {
conversation_agent: { language?: string } | null;
}
@@ -28,7 +28,10 @@ import { fetchCloudStatus } from "../../data/cloud";
import { apiContext, configContext } from "../../data/context";
import { haStyleDialog, haStyleDialogFixedTop } from "../../resources/styles";
import { DialogMixin } from "../dialog-mixin";
import type { CameraStreamInfoDialogParams } from "./show-dialog-camera-stream-info";
import type {
CameraStreamInfo,
CameraStreamInfoDialogParams,
} from "./show-dialog-camera-stream-info";
// Ordered from the fastest to the most compatible
const STREAM_TYPES: { type: CameraStreamType; icon: string }[] = [
@@ -53,6 +56,23 @@ class DialogCameraStreamInfo extends DialogMixin<CameraStreamInfoDialogParams>(
@state() private _cloudIceServers = false;
@state() private _info?: CameraStreamInfo;
private _unsubscribe?: () => void;
public connectedCallback() {
super.connectedCallback();
this._unsubscribe = this.params?.subscribe((info) => {
this._info = info;
});
}
public disconnectedCallback() {
this._unsubscribe?.();
this._unsubscribe = undefined;
super.disconnectedCallback();
}
protected firstUpdated() {
this._fetchCloudIceServers();
}
@@ -74,10 +94,10 @@ class DialogCameraStreamInfo extends DialogMixin<CameraStreamInfoDialogParams>(
}
protected render() {
if (!this.params) {
if (!this._info) {
return nothing;
}
const { status, supportedTypes } = this.params;
const { status, supportedTypes } = this._info;
// Without a video stream, still images are all the camera has
const stillImagesOnly = supportedTypes?.length === 0;
// MJPEG is only the fallback, only worth explaining while it shows
@@ -161,7 +181,7 @@ class DialogCameraStreamInfo extends DialogMixin<CameraStreamInfoDialogParams>(
type: CameraStreamType;
icon: string;
}) {
const { status } = this.params!;
const { status } = this._info!;
const current = !status.connecting && status.type === type;
const upgrading = status.upgrading === type;
return html`
@@ -1,12 +1,17 @@
import { fireEvent } from "../../common/dom/fire_event";
import type { CameraStreamStatus, StreamType } from "../../data/camera-streams";
export interface CameraStreamInfoDialogParams {
export interface CameraStreamInfo {
status: CameraStreamStatus;
/** The stream types the camera supports, undefined while unknown */
supportedTypes?: StreamType[];
}
export interface CameraStreamInfoDialogParams {
/** Calls back with the current info right away and on every change */
subscribe: (callback: (info: CameraStreamInfo) => void) => () => void;
}
export const showCameraStreamInfoDialog = (
element: HTMLElement,
params: CameraStreamInfoDialogParams
+6
View File
@@ -2,4 +2,10 @@ import "@webcomponents/scoped-custom-element-registry/scoped-custom-element-regi
import "../resources/scoped-registry-ready";
import "../layouts/home-assistant";
// Custom cards and plugins can reach the helpers on any page, not only once a
// dashboard has loaded.
Object.assign(window, {
loadCardHelpers: () => import("../panels/lovelace/custom-card-helpers"),
});
import("../resources/append-ha-style");
@@ -93,13 +93,13 @@ export class CloudRemotePref extends LitElement {
<ha-card
outlined
header=${this.hass.localize(
"ui.panel.config.cloud.account.remote.card_title"
"ui.panel.config.cloud.account.remote.title"
)}
>
<div class="header-actions">
<ha-switch
.accessibleLabel=${this.hass.localize(
"ui.panel.config.cloud.account.remote.card_title"
"ui.panel.config.cloud.account.remote.title"
)}
.checked=${remote_enabled}
@change=${this._toggleChanged}
@@ -104,7 +104,7 @@ export class CloudWebhooks extends LitElement {
<div class="card-actions">
<ha-button
appearance="plain"
href="https://www.nabucasa.com/config/webhooks"
href="https://www.nabucasa.com/config/webhooks/"
target="_blank"
rel="noreferrer"
>
@@ -514,8 +514,16 @@ class AddIntegrationDialog extends LitElement {
return [...integrations]
.filter((item) => !brand || item.domain === brand)
.sort(byName)
.flatMap((item) => this._brandRows(item))
.filter((row) => !brand || !row.is_header);
.flatMap((item) =>
this._brandRows(item)
.filter((row) => !row.is_header)
// The brand on the second line, so its entries read as a group
.map((row) =>
brand || !this._isBrand(item)
? row
: { ...row, description: item.name }
)
);
}
// A brand shows its integrations here, not itself, like the website
if (category) {
@@ -1207,17 +1215,11 @@ class AddIntegrationDialog extends LitElement {
})}
>
${
!this._stickyBrand
? nothing
: this._filter
? html`<ha-section-title class="sticky">
${this._stickyBrand}
</ha-section-title>`
: html`<ha-integration-list-title
class="sticky raised"
>
${this._stickyBrand}
</ha-integration-list-title>`
this._stickyBrand
? html`<ha-section-title class="sticky">
${this._stickyBrand}
</ha-section-title>`
: nothing
}
<ha-list-virtualized
.rows=${this._filter ? rows : this._withEndSpace(rows)}
@@ -1771,7 +1773,7 @@ class AddIntegrationDialog extends LitElement {
);
}
// The virtualizer positions rows, so CSS sticky can't hold the brand
// The virtualizer positions rows, so CSS sticky can't hold the section title
@eventOptions({ passive: true })
private _visibilityChanged(ev: HASSDomEvent<HaListVisibilityChangedDetail>) {
const rows = this._getRows();
@@ -1794,11 +1796,7 @@ class AddIntegrationDialog extends LitElement {
return html`<div style="height: var(--ha-space-2)"></div>`;
}
if (integration.is_header) {
return this._filter
? html`<ha-section-title>${integration.name}</ha-section-title>`
: html`<ha-integration-list-title>
${integration.name}
</ha-integration-list-title>`;
return html`<ha-section-title>${integration.name}</ha-section-title>`;
}
return html`
<ha-integration-list-item
@@ -26,6 +26,7 @@ import { customElement, property, state } from "lit/decorators";
import { classMap } from "lit/directives/class-map";
import memoizeOne from "memoize-one";
import { navigate } from "../../../common/navigate";
import { formatListWithAnds } from "../../../common/string/format-list";
import { copyToClipboard } from "../../../common/util/copy-clipboard";
import "../../../components/ha-dropdown";
import type { HaDropdownSelectEvent } from "../../../components/ha-dropdown";
@@ -95,6 +96,9 @@ export class HaConfigEntryRow extends LitElement {
@property({ attribute: false }) public data!: ConfigEntryData;
/** The loaded integrations that lose this integration with this entry. */
@property({ attribute: false }) public dependents?: IntegrationManifest[];
@state() private _expanded = true;
@state() private _devicesExpanded = true;
@@ -812,14 +816,33 @@ export class HaConfigEntryRow extends LitElement {
const applicationCredentialsId =
await this._applicationCredentialForRemove(entryId);
const text = this.hass.localize(
"ui.panel.config.integrations.config_entry.delete_confirm_text"
);
const confirmed = await showConfirmationDialog(this, {
title: this.hass.localize(
"ui.panel.config.integrations.config_entry.delete_confirm_title",
{ title: this.data.entry.title }
),
text: this.hass.localize(
"ui.panel.config.integrations.config_entry.delete_confirm_text"
),
text: this.dependents?.length
? html`${text}<br /><br />${this.hass.localize(
"ui.panel.config.integrations.config_entry.delete_confirm_dependents",
{
count: this.dependents.length,
integrations: formatListWithAnds(
this.hass.locale,
this.dependents.map((manifest) =>
domainToName(this.hass.localize, manifest.domain, manifest)
)
),
name: domainToName(
this.hass.localize,
this.data.entry.domain,
this.manifest
),
}
)}`
: text,
confirmText: this.hass!.localize("ui.common.delete"),
dismissText: this.hass!.localize("ui.common.cancel"),
destructive: true,
@@ -21,7 +21,7 @@ import memoizeOne from "memoize-one";
import { ensureArray } from "../../../common/array/ensure-array";
import { isComponentLoaded } from "../../../common/config/is_component_loaded";
import { QueryParamsController } from "../../../common/controllers/query-params-controller";
import { ContextSubscriptionController } from "../../../common/decorators/consume";
import { consume } from "../../../common/decorators/consume";
import type { HASSDomTargetEvent } from "../../../common/dom/fire_event";
import { computeDeviceNameDisplay } from "../../../common/entity/compute_device_name";
import {
@@ -176,9 +176,9 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
@state() private _manifest?: IntegrationManifest;
/** The manifests of all loaded integrations, to find the dependents. */
@state() private _loadedManifests?: DomainManifestLookup;
private _manifestsConsumer?: ContextSubscriptionController<DomainManifestLookup>;
@consume({ context: manifestsContext, subscribe: true })
@state()
private _loadedManifests?: DomainManifestLookup;
@state() private _extraConfigEntries?: ConfigEntry[];
@@ -432,17 +432,23 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
this.domain
);
const dependents = this._getDependents(
this.domain,
this._loadedManifests,
this.hass.localize,
this.hass.locale.language
);
// Without the dependents, a dependency looks like a YAML integration.
const dependents =
this._manifest && !this._manifest.config_flow
? this._getDependents(
this.domain,
this._loadedManifests,
this.hass.localize,
this.hass.locale.language
)
: [];
const showDependents = normalEntries.length === 0 && dependents.length > 0;
const dependencyOnly =
normalEntries.length === 0 &&
dependents.length > 0 &&
!this._manifest?.config_flow;
// Deleting the last entry in use leaves the dependents without it.
const entriesInUse = configEntries.filter(
(entry) => entry.source !== "ignore" && !entry.disabled_by
);
const lastEntryId =
entriesInUse.length === 1 ? entriesInUse[0].entry_id : undefined;
// Hold back the YAML texts and "Add entry" until the manifest and the
// dependents are known. Entries do not wait, so a failed request cannot
// hide them.
@@ -461,7 +467,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
const showAddEntry =
this._manifest?.integration_type !== "hardware" &&
!showDependents &&
!dependencyOnly &&
!dependentsLoading &&
!setUpInPanel &&
(!this._manifest?.single_config_entry ||
@@ -653,7 +659,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
}
${
normalEntries.length === 0 &&
!showDependents &&
!dependencyOnly &&
!dependentsLoading &&
!setUpInPanel &&
this._manifest &&
@@ -1010,6 +1016,11 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
.diagnosticHandler=${this._diagnosticHandler}
.entities=${this._entities}
.data=${data}
.dependents=${
data.entry.entry_id === lastEntryId
? dependents
: undefined
}
data-entry-id=${data.entry.entry_id}
></ha-config-entry-row>`
)}
@@ -1018,19 +1029,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
: nothing
}
${
showDependents
? html`<div class="section">
<h3 class="section-header">
${this.hass.localize(
"ui.panel.config.integrations.integration_page.used_by"
)}
</h3>
${this._renderDependents(dependents)}
</div>`
: nothing
}
${
showDependents ||
dependencyOnly ||
dependentsLoading ||
(setUpInPanel && normalEntries.length === 0)
? nothing
@@ -1077,6 +1076,11 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
.diagnosticHandler=${this._diagnosticHandler}
.entities=${this._entities}
.data=${data}
.dependents=${
data.entry.entry_id === lastEntryId
? dependents
: undefined
}
data-entry-id=${data.entry.entry_id}
></ha-config-entry-row>`
)}
@@ -1084,26 +1088,23 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
}
</div>`
}
${
dependents.length
? html`<div class="section">
<h3 class="section-header">
${this.hass.localize(
"ui.panel.config.integrations.integration_page.used_by"
)}
</h3>
${this._renderDependents(dependents)}
</div>`
: nothing
}
</div>
</hass-subpage>
`;
}
// Only an integration without a config flow needs the loaded manifests, so
// other integration pages do not make the context fetch them.
private _watchLoadedManifests(): void {
if (this._manifestsConsumer) {
return;
}
this._manifestsConsumer = new ContextSubscriptionController(
this,
manifestsContext,
(manifests) => {
this._loadedManifests = manifests;
}
);
}
private _getDependents = memoizeOne(
(
domain: string,
@@ -1199,9 +1200,6 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
return;
}
this._manifest = await fetchIntegrationManifest(this.hass, this.domain);
if (!this._manifest.config_flow) {
this._watchLoadedManifests();
}
if (
this._manifest.integration_type &&
!["device", "hub", "service"].includes(this._manifest.integration_type)
@@ -9,6 +9,8 @@ export {
showPromptDialog,
} from "../../dialogs/generic/show-dialog-box";
export { importMoreInfoControl } from "../../dialogs/more-info/state_more_info_control";
export { subscribeVisibility } from "../../common/condition/subscribe-visibility";
export { createBadgeElement } from "./create-element/create-badge-element";
export { createCardElement } from "./create-element/create-card-element";
export { createHeaderFooterElement } from "./create-element/create-header-footer-element";
+1 -1
View File
@@ -7616,7 +7616,6 @@
},
"remote": {
"title": "Remote access",
"card_title": "Remote connection",
"connected": "Connected",
"not_connected": "Not connected",
"reconnecting": "Not connected. Trying to reconnect.",
@@ -8266,6 +8265,7 @@
"delete": "Delete",
"delete_confirm_title": "Delete {title}?",
"delete_confirm_text": "Its devices and entities will be permanently deleted.",
"delete_confirm_dependents": "{integrations} {count, plural,\n one {depends on {name} and may stop working.}\n other {depend on {name} and may stop working.}\n}",
"enable_debug_logging": "Enable debug logging",
"reconfigure": "Reconfigure",
"reload": "Reload",
@@ -0,0 +1,109 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { subscribeVisibility } from "../../../src/common/condition/subscribe-visibility";
import type { VisibilityCondition } from "../../../src/panels/lovelace/common/validate-condition";
import type { HomeAssistant } from "../../../src/types";
interface CapturedSubscription {
push: (message: { result?: boolean }) => void;
unsub: ReturnType<typeof vi.fn>;
condition: unknown;
}
let subs: CapturedSubscription[];
const tick = () =>
new Promise<void>((resolve) => {
setTimeout(resolve, 10);
});
const createHass = (userId = "user1"): HomeAssistant =>
({
connection: {
subscribeMessage: vi.fn(
(
onChange: CapturedSubscription["push"],
msg: { condition: unknown }
) => {
const unsub = vi.fn();
subs.push({ push: onChange, unsub, condition: msg.condition });
return Promise.resolve(unsub);
}
),
},
states: {},
user: { id: userId },
locale: { time_zone: "local" },
config: { time_zone: "America/New_York" },
}) as unknown as HomeAssistant;
describe("subscribeVisibility", () => {
beforeEach(() => {
subs = [];
});
it("checks client conditions again with each hass passed to update", async () => {
const onChange = vi.fn();
const conditions: VisibilityCondition[] = [
{ condition: "user", users: ["user1"] },
];
const subscription = subscribeVisibility(
createHass("user1"),
conditions,
onChange
);
await tick();
expect(onChange).toHaveBeenLastCalledWith("visible", undefined);
subscription.update(createHass("user2"));
expect(onChange).toHaveBeenLastCalledWith("hidden", undefined);
});
it("closes core subscriptions and stops reporting after unsubscribe", async () => {
const onChange = vi.fn();
const conditions: VisibilityCondition[] = [
{ condition: "state", entity: "light.kitchen", state: "on" },
];
const subscription = subscribeVisibility(
createHass(),
conditions,
onChange
);
await tick();
expect(subs).toHaveLength(1);
subs[0].push({ result: true });
expect(onChange).toHaveBeenLastCalledWith("visible", undefined);
onChange.mockClear();
subscription.unsubscribe();
await tick();
expect(subs[0].unsub).toHaveBeenCalled();
expect(onChange).not.toHaveBeenCalled();
});
it("sends the context entity to core for conditions without one", async () => {
const conditions: VisibilityCondition[] = [
{ condition: "state", state: "on" },
];
subscribeVisibility(createHass(), conditions, vi.fn(), {
entity_id: "light.kitchen",
});
await tick();
expect(subs).toHaveLength(1);
expect(subs[0].condition).toEqual({
condition: "state",
entity_id: "light.kitchen",
state: "on",
});
});
});
+44 -1
View File
@@ -1,5 +1,8 @@
import { describe, expect, it } from "vitest";
import { getConfigSubpageTitle } from "../../src/data/panel";
import {
getConfigSubpageTitle,
getSelectedPanelUrlPath,
} from "../../src/data/panel";
import type { PageNavigation } from "../../src/layouts/hass-tabs-subpage";
import type { HomeAssistant } from "../../src/types";
@@ -83,3 +86,43 @@ describe("getConfigSubpageTitle", () => {
).toBeUndefined();
});
});
describe("getSelectedPanelUrlPath", () => {
const urlPaths = ["lovelace", "history", "config/logs", "config/logs/raw"];
it("falls back to the first path segment", () => {
expect(getSelectedPanelUrlPath(urlPaths, "/config/automation")).toBe(
"config"
);
expect(getSelectedPanelUrlPath(urlPaths, "/profile/general")).toBe(
"profile"
);
});
it("selects a panel whose url_path has several segments", () => {
expect(getSelectedPanelUrlPath(urlPaths, "/config/logs")).toBe(
"config/logs"
);
expect(getSelectedPanelUrlPath(urlPaths, "/config/logs/details")).toBe(
"config/logs"
);
});
it("prefers the most specific url_path", () => {
expect(getSelectedPanelUrlPath(urlPaths, "/config/logs/raw")).toBe(
"config/logs/raw"
);
});
it("only matches whole segments", () => {
expect(getSelectedPanelUrlPath(urlPaths, "/config/logsfoo")).toBe("config");
});
it("keeps matching single segment panels on their subpaths", () => {
expect(getSelectedPanelUrlPath(urlPaths, "/lovelace/0")).toBe("lovelace");
});
it("returns an empty url_path for the root path", () => {
expect(getSelectedPanelUrlPath(urlPaths, "/")).toBe("");
});
});