Compare commits

..
Author SHA1 Message Date
Bram KragtenandClaude Opus 5.5 77a4af6adf Bumped version to 20261125.0
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 16:09:42 +01:00
Bram KragtenandClaude Opus 5.5 94bb00d591 Merge branch 'rc' into dev
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 16:09:39 +01:00
c925ed1a9f Show integration categories in the Marketplace (#55130)
* Browse integrations by category in the add integration dialog

* Match the subcategory row height to the categories

* Address review feedback on the category browsing

* Show integration categories in the Marketplace

* Load the category names again after a language change

* Keep the focus and the manage link in the category browsing

* Keep the category filter and pass it through My links

Remember a picked category like the other filters, take the category
along in My Home Assistant links, and drop the casts on its translation
keys.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Look up category names and icons in one place

The add integration dialog and the Marketplace now share the helpers for
the name, icon and matching of a category.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Wendelin <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-25 16:07:12 +01:00
renovate[bot] 81579b321c Update pnpm to v12.23.0 (#56138)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-25 15:57:17 +01:00
0d4554a032 Add address search to location selector (#54351)
* Implement location search functionality in location selector with Lat and Long based place addition

* Improve places search handling and address encoding

Updated places search to handle undefined and null values, and encoded the address before searching.

* Fix HTML syntax in ha-selector-location.ts

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* Add location address and search error translations; update HaLocationSelector for improved error handling

* Refactor HaLocationSelector: import HaLocationsEditor type and enhance _placeSelected method with async handling

* Refactor location selector and OpenStreetMap integration

- Introduced formatOpenStreetMapPlace function for consistent place formatting.
- Updated ha-selector-location to utilize new formatting function.
- Enhanced searchPlaces to build URL parameters more cleanly.
- Improved onboarding-location to use the new formatting function.
- Added tests for formatOpenStreetMapPlace and searchPlaces.
- Updated translations for location-related labels and messages.

amend email

* Fix location search results and queued submissions

Address review feedback on result slots, localized address details, loading controls, and realistic formatter fixtures. Cover queued searches and keyboard selection on desktop and mobile.

Co-authored-by: Copilot <[email protected]>

* Prevent location search Enter from submitting parent flows

Stop Enter propagation for result activation and IME confirmation while preserving composition defaults and keyboard selection. Extend the existing browser workflow to guard both event boundaries.

Co-authored-by: Copilot <[email protected]>

* Restore focus after selecting a location search result

Move focus to the existing search input before removing a focused result. Leave focus alone when the selected row is not focused, and extend the existing keyboard regression test.

Co-authored-by: Copilot <[email protected]>

* Align location search with onboarding review feedback

Use read-only loading and shared search status messages instead of queued searches. Preserve keyboard focus and Enter boundaries, announce selections, deduplicate place names, and simplify disclosure and list styling.

Move the focused keyboard regression into the Config panel suite and remove the queued-search success/failure loop.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot <[email protected]>
2026-11-25 15:49:55 +01:00
WendelinandClaude Opus 5.5 e04c342bce Keep the startup toast usable while a dialog is open (#56134)
* Show the startup toast through the notification manager

The "Home Assistant is starting" toast was its own element outside the
notification manager, so a modal dialog made its buttons inert and the
fix from #56063 did not apply to it. It now goes through showToast().

Toasts can now show a supporting text line, and toast actions can be
icon buttons that leave the toast open. The startup toast uses both to
keep its look and its info button.

The startup details are only offered to admins, on the starting toast
and on the completion toast.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Show the startup toast once translations have loaded

The toast no longer needs English fallbacks for its texts and labels.
It passes translation keys, so the notification manager localizes it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-25 15:33:42 +01:00
Paul Bottein fe89425698 Save the add dialog's Browse by choice only from its chip (#56140) 2026-11-25 15:31:23 +01:00
Paulus SchoutsenandClaude Opus 5.5 2ae1c2c92b Add timer list card and more info dialog (#56099)
* Add timer list card and more info control

Core has a timer_list entity domain. An entity holds many independent
countdown timers, and the frontend showed only the number of active ones.

Add a shared ha-timer-list component that subscribes to the timers of an
entity. It shows each timer with a live countdown and a progress bar, and
it offers the actions the entity supports: start, pause, resume, add one
minute and cancel. It shows active and paused timers only.

Use the component in a new timer-list card and in the more info dialog of
timer_list entities. Add gallery pages for both, backed by an in-memory
stub so the actions work there.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5KtV4V6RNqNdajC65v

* Show finished timers in the timer list for 5 minutes

A finished timer vanished from the list the moment it ended, so a glance
at the card could miss it. Keep a finished timer visible for 5 minutes
after it ends, marked as finished. Offer a remove button when the entity
supports removal. Cancelled timers stay hidden.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5KtV4V6RNqNdajC65v

* Start timer list timers from a dialog

The name and duration fields took a large part of the timer list card
and of the more info dialog. Replace them with a "Start timer" button
that opens a dialog with the same fields.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5KtV4V6RNqNdajC65v

* Put the start timer button below the list in more info

The more info dialogs of scripts, timers and automations put their action
buttons below the content. Follow that for timer lists. The card keeps the
button above the list, as the to-do list card does for its add field.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5KtV4V6RNqNdajC65v

* Drop the leading zero from timer list countdowns

The timer entity shows its countdown as "9:53". The timer list showed
"09:53". Format the countdown without a leading zero on the first unit.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5KtV4V6RNqNdajC65v

* Treat timer lists like timers in state color and area dashboards

A timer entity colors its icon while it runs, and the areas dashboard
lists it with the other helpers of an area. Do the same for timer list
entities. A timer list is active when it has at least one active timer.

Add the two timer list gallery pages to the gallery smoke tests.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5KtV4V6RNqNdajC65v

* Fix starting a timer on an empty list in the timer list demo stub

The stub read the timers of an entity that had no seed data, so starting
the first timer on the empty gallery example failed.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5KtV4V6RNqNdajC65v

* Fix timer list subscription timing and a demo interval leak

The timer list decided whether to subscribe before the entity state of a
changed entity was current, so a switch from an unavailable list to an
available one stayed unsubscribed. Decide after the update instead.

An update queued before removal could subscribe again on the removed
element. Skip the work when the element is not connected.

The demo stub never stopped its one-second interval. Return a stop
function and call it when the gallery page is removed.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5KtV4V6RNqNdajC65v

* Add screenshots for the pull request description

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5KtV4V6RNqNdajC65v

* Remove the pull request screenshots

They are only referenced from the pull request description.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5KtV4V6RNqNdajC65v

* Show unavailable timer lists and label the duration field

An unavailable timer list rendered no content, so a card without a title
and without the start button was blank. Show that the list is
unavailable.

The duration field in the start timer dialog showed only the unit
abbreviations and had no accessible name. Give it the Duration label
that the timer helper settings use.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5KtV4V6RNqNdajC65v

* Rename the timer list button, sort timers, and clarify adding time

Design review feedback on the timer list:
- "Start timer" read as starting an existing timer. Call it "Add timer".
- Show finished timers first, then running and paused timers with the
  soonest to finish first.
- The timer-plus icon did not say what it adds. Show "+1:00" as text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5KtV4V6RNqNdajC65v

* Add screenshots for a pull request comment

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5KtV4V6RNqNdajC65v

* Remove the pull request comment screenshots

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5KtV4V6RNqNdajC65v

* Fix the timer list add time label and leftover start timer wording

The add time button had an accessible name that did not contain its
visible "+1:00" text, so voice control users could not say what they
see. Use the visible text as its name and keep "Add 1 minute" as the
tooltip.

The card editor and the gallery still said "start a timer" after the
button became "Add timer".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5KtV4V6RNqNdajC65v

---------

Co-authored-by: Claude <[email protected]>
2026-11-25 15:29:56 +01:00
WendelinandClaude Opus 5.5 2b903846d2 Move the camera microphone row height to its more info (#56137)
The more info dialog listened to camera-capabilities-changed from the
stream and reserved 72px for the microphone row of the camera's info.
more-info-camera now reports the height of its row itself, so the value
lives next to the row it describes.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-25 15:10:18 +01:00
af8d129871 Add device or integration dialog with categories, brands and search (#55125)
* Browse integrations by category in the add integration dialog

* Match the subcategory row height to the categories

* Address review feedback on the category browsing

* Keep the focus and the manage link in the category browsing

* Prototype the add device or integration dialog

Coded prototype on top of the category browsing: one global search, Browse
by/Connection/Type filter chips, Featured and Works with Home Assistant
collections, Discovered grouped with adding a device, cards with a plus or
a chevron, a phone drill-down like the automation editor, and a floating
manage footer for discovered devices.

Includes a temporary demo panel (demo-add-integration.ts and the // DEMO
lines) and copied placeholder data (featured, Works with Home Assistant,
category icons) that core does not send yet.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Refine the add device or integration prototype

- Mark YAML-only integrations with a YAML label and a chevron instead of
  a code icon, so a card ends with a plus or a chevron only
- In a category, list a brand's integrations in it instead of the brand,
  like the website (Google is Google Gemini in AI models), and count them
  the same way in the sidebar
- Drop the fake demo integrations from the list
- Hide the demo panel on Marketplace pages

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Remove the type filter from the add device or integration dialog

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep the filter row of the add device or integration dialog from scrolling vertically

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Suggest integrations from the apps on the phone in the add dialog prototype

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Leave discovered integrations out of the phone suggestions

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Remove the phone suggestions from the add device or integration prototype

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Remove the demo panel from the add device or integration prototype

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Address review findings on the add device or integration dialog

- Open a passed category on phones, and keep Enter from picking a row
  that isn't on screen
- Move the focus along when drilling in and out on a phone
- Make the tree's chevrons clickable, mirror them in RTL, and use
  logical margins and paddings
- Complete the tree's arrow keys: into an open category, and back from
  a subcategory
- List brands that only have protocol devices, like Aqara
- Leave the YAML label off categories and "show more" in search results
- Browse everything when the connection filter empties what was browsed
- Drop the category icon fallback, core sends them now
- Remove leftover comments, styles and an unused translation

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Leave the Featured and Works with Home Assistant collections out for now

Only the website has these lists. They come back in a follow-up, once
core sends them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep the add dialog's sheet below a large top safe area

The bottom sheet caps its height below the top safe area, so the lists
are sized from that same height.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* End the add dialog's panes and lists on one line

The sheet now fills its height with flex like the dialog, instead of
heights worked out by hand. The browse pane, the list and the search
results share one bottom margin, and the cards get room after the last
one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Let the add dialog's lists scroll to the edge again

The room goes after the last card instead of under the list, as much
as the browse pane has below it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Give the last discovered card room below it

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Simplify the add device or integration dialog

- One helper for what a browse pick or search result shows, and one for
  dropping a selection that has nothing to show
- Pass the connection itself instead of a memoized filters object
- Drop the size snapshots and minimum sizes, the dialog has a fixed size
- Render only the subcategories shown while collapsed, instead of
  clipping the rest to a calculated height, so the keyboard can't reach
  hidden rows
- Drop the unused integration_type on the rows
- Focus the back button after drilling in; ha-icon-button-prev now
  forwards focus to its button

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Trim comments in the add device or integration dialog

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Use wa-tree for the add dialog's categories, like the automation editor

The category tree was rebuilt from list rows with its own chevrons,
ARIA roles and arrow key handling. wa-tree brings all of that, so the
dialog now uses it on wide screens, and keeps the list to drill into
on a phone, the same split as the automation editor's targets.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Follow the frontend standards in the add device or integration dialog

- Import ha-adaptive-dialog instead of relying on another chunk
- Count an integration of more than one brand once, like the results
- Type the new event handlers instead of casting to any
- Drop the any casts on translation keys
- Use new translation keys where the meaning changed
- Use spacing tokens and logical padding

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Center the category icons in the add dialog's browse pane

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Center the counts in the add dialog's browse pane

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Use async/await for the integration category icons

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Clarify the categories comments

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Inset the add dialog's titles like the automation editor's

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Move the add dialog's brand titles into their own component

The rows render in the virtualized list's shadow root, so the titles
were styled inline, and the same style was repeated as .items-title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Move the add dialog's list types and helpers into their own file

The list item imported its type from the dialog. Both import it from
add-integration-list.ts now, with the constants and pure helpers. The
test covers inCategory, which must not match energy_storage for energy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Name the raw integrations and helpers in the add dialog's memos

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Name the search's integrations by domain in the add dialog

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Render nothing instead of empty strings in the discovered list

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Clarify the add dialog's category param comment

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Address Copilot's review of the add dialog

- Set the dvh heights only where dvh works: a custom property doesn't
  fall back to an earlier vh one, so older browsers lost the height
- Move the focus after drilling a frame later, once the back button
  and the browse rows have rendered

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep the discovered count visible on the selected row

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Scroll the browse pane to what was picked by searching

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Center the brand icons in the add dialog's browse pane

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Center what was picked by searching in the browse pane

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Show a custom integration's details under the brand it replaces

A custom integration replacing a core one listed under a brand kept the
core details there, and search and categories only show that row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Filter a category by the brand's rows, like its count

A custom integration replacing one under a brand brings its own
categories, so the brand's core categories could hide it from a
category that counted it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Wendelin <[email protected]>
Co-authored-by: marcinbauer85 <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
2026-11-25 15:05:32 +01:00
Martin Salinas c4c84361cb Send slider keyboard changes when focus leaves before the key is released (#56132) 2026-11-25 14:57:07 +01:00
G JohanssonandClaude Opus 5.5 aedc5f1e7e Show the debug logging option on the page of an integration that is not set up (#56124)
* Add debug logging to the integration setup dialog

Users can enable debug logging from a menu in the config flow dialog.
This also works for integrations that are not set up yet, so the log
covers the initial setup without YAML or an action call.

A banner shows while debug logging is on. Disabling it offers the log
for download. On the success step, one button disables debug logging
and downloads the log.

The integration page now shows the debug logging menu item when the
integration is not listed by logger/log_info yet. The enable, disable
and download logic moves to a shared helper.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep the debug logging button label on one line

The alert action area is only as wide as its content allows, so the
"Disable and download log" label wrapped one word per line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Mock the log info subscription in the config flow dialog tests

The dialog subscribes to log info for config flows. The fake connection
in the tests does not support collection subscriptions, so opening the
dialog failed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep the integration page debug logging state in sync with core

Core leaves out an integration that is not loaded once its custom log
level is removed. The page kept the old debug level, so disabling debug
logging did not offer the log for download.

Wait for the first log info before showing the debug logging menu item,
so it does not offer to enable debug logging when it is already on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep debug logging controls visible while a setup step loads

The dialog keeps the current step while the next step loads, so the
debug logging menu and banner can stay. Before, they disappeared during
a slow setup request.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Limit debug logging changes to the integration page

Remove the debug logging menu and banners from the setup dialog, as
requested in review, to keep setup flows minimal. Debug logging for an
integration that is not set up yet starts from its integration page.

The shared helper is no longer needed, so its code moves back into the
integration page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-25 13:10:04 +00:00
Maarten Lakerveld d1952af771 Pick the automation sidebar from the row that opened it (#55986)
* Pick the automation sidebar from the row that opened it

The sidebar guessed its type from the shape of the row's config. Rows
accept any YAML, so a condition row holding a service action such as
{ action: "number.set_value" } opened the action sidebar, which then
threw on the string action and rendered nothing.

Each row now tags its sidebar config with a type, and the sidebar uses
that. Such a condition row opens the condition sidebar with its YAML,
where it can be fixed.

* Read the sidebar type when showing trigger indices

The check worked out the row from the shape of its config, like the
sidebar did. Now it switches on the type the row sets, so a trigger
condition entered as YAML in a trigger row no longer shows the indices.

* Guard sidebar header lookups against non-string types

Rows now pick the sidebar, so YAML like `condition: false` or
`trigger: false` reaches the header lookups, which call .includes on
the value and threw during render. Only look up the domain and name
for string types so the YAML editor stays reachable.
2026-11-25 12:52:12 +00:00
WendelinandClaude Opus 5.5 3471667bd5 Translate automation validation errors and show them at more fields (#56111)
* Translate validation errors and show them at more fields

Core sends a translation key with the generic validation errors, like
`required` or `value_one_of`, so the frontend translates those and keeps
core's message for the rest. The remaining ha-form editors and the delay
action show their errors at the field instead of in the sidebar alert.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Show only the repeat options' own errors in the repeat form

Errors of nested rows in while, until and sequence stay on those rows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJM4cuoppfSaBaZN3x

* Name fields without the colon of their label in errors

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJM4cuoppfSaBaZN3x

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-25 11:15:00 +00:00
WendelinandClaude Opus 5.5 22c6f16ecb Show automation validation errors on the rows they belong to (#55830)
* Show automation validation errors on the rows they belong to

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Follow error rows through moves and saves

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep errors on duplicate rows and rows changed while saving

Identical rows keep their own errors after the YAML is parsed again, and
a save whose config changed meanwhile checks the current config in full,
so rows renamed and moved during the save stay marked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Adapt error rows to core's structured validation errors

Core now reports paths as written in the config, so the mapping of
flattened trigger lists and the parallel shorthand is gone. Only blocks
written as a single item still need the list index the editor shows.

Match the error type to core's contract, show the save failed toast
before revalidating so a later successful save closes it, and render
error alerts with one shared template.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Move errors with their rows and fix review findings

Follow the shown errors through moves and deletes right away instead of
waiting for revalidation, resolve the first row of a single item block
when tracking error items, close the save failed toast also when no
errors are left, and don't expand trigger rows that open in the sidebar.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Track single item blocks through moves and fix review findings

Blocks written as a single item, like `default: { delay: … }`, are now
indexed at the row path the editor uses, so their errors move with them.
Pending validations no longer apply after the editor is left, and the
problem count uses a plural form.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJM4cuoppfSaBaZN3x

* Track template conditions written as a string and keep errors of missing sections

A template condition written as a string is a row, so its errors stay on it
and follow it when the visual editor turns it into an object. Sections that
are missing aren't validated by core, so their errors stay while editing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJM4cuoppfSaBaZN3x

* Keep errors on rows edited to match another and of nested service data

Only lists of rows hold rows, so objects in service data belong to their
action. A row edited to the content of another row that is still there keeps
its errors. Errors of the first check of an unavailable automation follow the
config when the editor changed it meanwhile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJM4cuoppfSaBaZN3x

* Track template conditions written as a single string

A condition block like `if: "{{ … }}"` is its first row, so its errors stay
on it when the visual editor turns it into a list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJM4cuoppfSaBaZN3x

* Revalidate when rows shift instead of following errors

Replace the follow and known item tracking with a simpler rule: errors
keep their paths while typing, and when rows move, are inserted or
deleted, they are hidden and checked again right away. Revalidation now
shows everything core returns, except new errors on the row open in the
sidebar.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Show errors of hidden rows on their collapsed block

Collapsed rows keep the rows inside rendered but hidden, so a collapsed
row on an error's path now owns it. Field errors use a map without a
prototype, so data keys like `constructor` keep their errors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-25 11:08:48 +01:00
WendelinandClaude Opus 5.5 f1e0084648 Make the camera more info as wide as its picture fits (#56109)
* Make the camera more info as wide as its picture fits

The more info of a camera was always 1024px wide, which left an ultra
wide camera with little height while there was room for more. In the info
view, the dialog now takes the width the picture needs to be as high as
there is room for, between 580px and 1920px, and changes it with a
transition. Dialogs get a --ha-dialog-width-transition for that.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eGpVK9wbGQz9K6fH3u

* Size a camera's more info by its picture also from a related view

A camera opened from a smaller entity's related view kept that entity's
medium dialog width, which doesn't use the picture's width.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eGpVK9wbGQz9K6fH3u

* Keep the camera's size when its more info opens again

Opening the more info of the camera that is already open reset the size
the player sent, and the player doesn't send it again. The height of the
picture now uses svh like the height limit of the dialog, because dvh can
be larger while the browser's toolbars are hidden.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eGpVK9wbGQz9K6fH3u

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-25 10:48:34 +01:00
Javier Torres 4db2b58687 Allow requiring client certificates in Link remote connection (#56093)
* Add client certificate toggle to cloud remote access

Add a Require client certificates switch to the remote access security
options. It is disabled unless the HTTP integration has an SSL peer
certificate configured.

* Confirm the remote access restart when toggling client certificates

* Handle ssl client context error

* Allow turning off client certificates when they can't be enforced

* Change approach: move config toggle to network page

* New changes in http integration
2026-11-25 10:45:19 +01:00
Petar Petrov ca3da4d3ca Keep short timeline state changes from merging into neighbours of the same state (#56131) 2026-11-25 09:42:43 +01:00
Petar Petrov 4485fc4ab3 Draw the power sources graph zero line above all series (#56000)
* Stop drawing idle power sources on the power graph axis

* Draw the power graph zero line above all series instead of hiding zeros

* Leave silent decoration series out of chart sonification
2026-11-25 09:39:57 +01:00
Maarten Lakerveld 688b310549 Read localize from the filters' i18n context (#56118)
The filter components consumed internationalizationContext twice: once
through consumeLocalize for _localize and once in full for _i18n. Use
_i18n.localize instead and drop the second subscription. HaFilterStates
now provides _i18n, so ha-filter-device-classes reuses it instead of
consuming the context again next to the inherited _localize.
2026-11-25 09:33:40 +01:00
Martin Salinas 976352c5c6 Fix light card errors when dragging the slider of an unknown light (#56129) 2026-11-25 09:22:14 +01:00
Martin Salinas baec09d83a Reset the circular slider when a touch is cancelled after a press (#56127)
* Reset the circular slider when a touch is cancelled after a press

* Put the circular slider's handle back when a touch is cancelled
2026-11-25 08:08:03 +00:00
Erwin Douna 8b6de6c38a Move database calculate into card (#56082)
* Move database calculate into card

* Drop duplicate spinner on database calculate button
2026-11-25 09:52:16 +02:00
Aidan TimsonandCopilot Autofix powered by AI 0b8ec5ee62 Make one slanted wave the default skeleton effect (#56089)
* Make one shared soft wave the default skeleton effect

* Run the skeleton wave across the content in one continuous loop

* Slant the skeleton wave from the top corner of the content

* Move loading guidance into a loading skill

* Place skeleton waves by the same direction they're drawn in

* Add optional chaining for getAnimations method

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* Measure the skeleton indicator and keep detached skeletons out of the wave

* Align text skeletons to the top of their line

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
2026-11-25 08:49:22 +01:00
renovate[bot] ba40d539cf Update dependency lint-staged to v17.6.2 (#56128)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-25 07:39:31 +00:00
Paul Bottein 1fc36ed56b Use the open tilt position and slat angles of covers (#56090)
* Use the open tilt position and slat angles of covers

* Read the closed tilt positions of covers
2026-11-25 09:30:16 +02:00
Aidan Timson 369adba1e5 Flatten the Status filter on the entities page (#56114) 2026-11-25 08:50:07 +02:00
Martin Salinas 2aa6217cc0 Only fire circular slider changing events when the stepped value changes (#56122)
* Only fire circular slider changing events when the stepped value changes

During a pan, value-changing was fired on every move even when the stepped
value hadn't changed, so consumers like the climate temperature control
re-rendered for nothing.

* Keep the light card's brightness visible until the drag ends

The readout hid 500 ms after the last value-changing event, so with
repeated values no longer fired it disappeared while still dragging
against the end of the slider. It now hides once the drag ends, and the
slider also signals the end when a pan is cancelled.

* Resend the slider value after a mid-drag update and clear the light card's hide timer before rescheduling it

* Only hide the light card's brightness once the drag ends

* Hide the light card's brightness when the slider loses focus
2026-11-25 06:47:54 +00:00
Franck Nijhof a212a3343b Add bulk delete to the automations and scripts lists (#56121) 2026-11-25 08:46:35 +02:00
Franck Nijhof fa4f3ce1b6 Add a serial number column to the devices table (#56123) 2026-11-25 08:42:19 +02:00
karwosts 3d18e7b9a2 Fix area card memoization perf (#56120) 2026-11-25 07:41:03 +02:00
WendelinandClaude Opus 5.5 1d76a22ba5 Keep the sidebar from shifting after closing notifications (#56116)
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-25 07:39:50 +02:00
WendelinandClaude Opus 5.5 e6d0a00c55 Keep the camera picture in view when zooming and loading (#56108)
* Keep the camera picture in view when zooming and while it loads

Zoom and pan now stop at the edges of the picture instead of the viewport,
so a camera with another aspect ratio than the player no longer shows its
black bars when zoomed in. The minimap shows the part of the picture in
view.

While the stream connects, the player keeps the room of the snapshot's
aspect ratio, or 16:9 until the snapshot loads, instead of the height of
an empty video. It changes to the stream's aspect ratio with a transition.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eGpVK9wbGQz9K6fH3u

* Open the camera player at the size of its last picture

The aspect ratio of each camera's picture is kept in the local storage,
so the player opens at the right size before the snapshot or the stream
loads. It is only written when the picture has another aspect ratio than
last time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eGpVK9wbGQz9K6fH3u

* Keep dashboards' camera posters as before and follow resizes in the app

Only the camera player loads the poster first to tell its size, so
camera cards don't load an MJPEG camera's snapshot they don't show. An
error message taller than the player's picture scrolls instead of being
cut off. The app's own HLS player follows the video when it changes size
without the window, like while the player changes its aspect ratio.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eGpVK9wbGQz9K6fH3u

* Center the camera picture when the player's height limits it

With a limited height, the aspect ratio also limits the width of the
picture, which then showed on the left of a wider player.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eGpVK9wbGQz9K6fH3u

* Zoom the camera picture into the bars next to it

When the player's height limits the picture, it keeps the player's whole
width with the picture in the middle, instead of being only as wide as
the picture. Zooming in fills the bars next to it, and zooming and
panning work there too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eGpVK9wbGQz9K6fH3u

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-24 16:17:54 +01:00
5db6b0e805 Keep toast buttons usable while a modal dialog is open (#56063)
* Keep toast buttons usable while a modal dialog is open

A modal dialog makes every element outside it inert. The toast stack
was painted above the dialog, but its buttons did not receive clicks.

Dialogs and bottom sheets now report when they open and close. The
notification manager moves into the topmost open one and moves back
when it closes. The dialog manager no longer moves a connected
notification manager back to the root on each toast.

A move disconnects the toasts, which stops their timers and
transitions. A toast now continues its last show or hide request when
it connects again.

Fixes #54867

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5FfgkdGNcZd9Qd9XKB

* Keep the toast deadline and sheet gestures across the move

A toast that moved into a dialog restarted its full timeout. It now
keeps the time at which its timer ends.

A toast inside a bottom sheet passed its touches to the sheet, so a
drag on the toast dragged the sheet. The sheet now ignores touches that
start in the notification manager.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5FfgkdGNcZd9Qd9XKB

* Don't register a dialog removed while it opens

A dialog removed right after it was opened still runs its queued update
and fires wa-show while detached. Registering it moved the notification
manager into the detached dialog, so toasts disappeared until the next
dialog opened or closed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep toasts above a bottom sheet that reopens itself

A bottom sheet that closed during a slider drag opens again right away,
entering the top layer above the toast stack. It stays registered, so
the notification manager didn't move and skipped reopening the stack,
which left the toasts behind the sheet. Reopen the stack on every change
of the open modals.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep Enter on toast buttons from submitting the dialog

Inside a dialog, Enter on a toast button also reached dialogs that
submit on Enter, like the ones to add a user or set up an MFA module.
Stop Enter and Space from leaving the toast stack. Escape still closes
the dialog.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
Co-authored-by: Wendelin <[email protected]>
2026-11-24 15:52:40 +01:00
hoizi89andClaude Opus 5.5 3fbe85d38f Add network health page to ZHA panel (#53641)
* Add network health page to ZHA panel

Zigbee problems are quiet. A device at the edge of its range keeps working
most of the time, and a device that joined but never finished its interview
simply exposes nothing at all. Neither is visible anywhere in the panel
today: link quality and last seen live on individual device pages, so
finding a weak device means opening all of them one by one.

This adds a "Network health" page next to "Network information". It opens
with the reachability of the network and how link quality is distributed
across it, followed by six findings, each expanding to the devices it
covers: not fully added, weak signal, not responding, low battery, nothing
heard for a while, and routers.

Every finding is grouped by area, so it is visible whether a problem is
spread over the house or concentrated in one room, and each device row
names the router it is connected through - the neighbour a weak device
depends on. Findings that expand carry one line of guidance; several of
them deliberately end in "otherwise there is nothing to do", so the page
can be read and dismissed without worry.

No new backend API is needed. Link quality, availability, last seen, area,
neighbours and entity states all come from the existing zha/devices
WebSocket command, and INCOMPLETE_PAIRING_STATUSES already existed but was
only used during the pairing flow.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01X32KGzLGEbQ2vY11rtMrt7

* Address review feedback on the ZHA network health page

Defects the review turned up:

- The status line mixed two device sets: the offline count came from the
  devices the page reports on, the total from all of them including the
  coordinator, so the sentence was normally off by one. Both now come from
  the same list.
- A failing zha/devices call left the page blank forever. It now shows a
  spinner while loading and an error alert carrying the cause.
- pairing_status was never going to arrive. zha/devices returns
  zha_device_info, which has no such field; it only travels with the
  pairing events. That branch is gone. A device exposing no entities is
  still detected, which is the case that matters.
- Resolving the parent router rescanned every neighbour table once per
  rendered row. It is built once per device list now.
- Areas are grouped by area_id instead of by their translated name.
- Four rules hard-coded left and right, so the page came apart in
  right-to-left locales. The chevron compensation in particular is no
  longer a padding hack on the summary row but a margin on the icon that
  takes the chevron's place.
- In English the percent sign follows the number directly.

Two more that only showed up while looking at the page:

- One sleeping device turned the status icon red next to the word
  "Online". The network is down once nothing answers at all, the rule the
  ZHA dashboard already uses, and the heading follows it now.
- A device that is not responding was counted in the signal distribution
  under its last known link quality, and its row showed that value in
  green. It has its own band in the bar now and its reading is greyed out:
  still worth reading, since a strong last reading points at power rather
  than range, but no longer claiming to be current.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01X32KGzLGEbQ2vY11rtMrt7

* Move ZHA network health logic into a testable module

The bands, thresholds and grouping lived inside the page component, where
nothing could reach them without rendering a component and a hass object.
They are plain functions over a device list, so they now live in
network-health.ts and the component keeps what actually needs it: icons,
translations, and the two lookups that read from hass - the battery level
of a device and the name of an area, both passed in as functions.

Nothing about the page changes. What is new is that the rules can be
stated as tests: where the thresholds sit and which side of them counts,
that a link quality of zero is weak rather than missing, that a silent
device is reported as such instead of by its last reading, that the
coordinator is left out, that a device may appear in more than one
finding, and that devices without an area stay apart from an area that
happens to carry the same label.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01X32KGzLGEbQ2vY11rtMrt7

* Follow upstream list components and ZHA types

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* Refresh the health snapshot, skip offline routers, guard last_seen

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* Rework ZHA network health page after UX review

Follow the design direction from the UX review:
- Top card explains the page is a snapshot and shows when it was updated
- Split findings into "Needs attention" (offline, setup not finished),
  listed with their devices, and "Worth a look" (weak signal, low battery,
  firmware update), each on its own subpage with the value before the chevron
- Rename "Not fully added" to "Setup not finished" and "Not responding"
  to "Offline"; show the power source on offline devices
- Drop the "Nothing heard for a while" and "Routers" findings
- Add a red dot to the Network health row on the ZHA dashboard when
  something needs attention
- Add a firmware update finding based on the devices' update entities
- Offline devices are no longer listed under weak signal or low battery

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Rate ZHA signal from the neighbour tables

The LQI of the last packet swings with every message. Use the link quality
the neighbour tables report instead, falling back to the last packet when no
neighbour lists the device:
- an end device uses the entry of the router it is a child of
- a router uses the best entry any neighbour reports, which ignores "Child"
  entries between routers and the near-zero values some firmware reports
  for every neighbour

On a real network this surfaces end devices in a poorly covered floor that
the last-packet LQI rated as strong.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Match the ZHA network health page to the Figma design

- Top card titled "Your Zigbee network" with the snapshot note, the signal
  bar (fair in a lighter green, segments spaced) and "Updated" with a clock
- "N devices need attention" as a flat list: device icon, name, and the
  status in red followed by power source, area and last seen; devices whose
  setup did not finish show when they joined, from the device registry
- "Worth a look" rows read "N devices with a weak signal" with the advice
  below; rows without devices, and the card when all are empty, are hidden

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep "Worth a look" visible when there is nothing to look at

Show "Signal, batteries and firmware look fine" instead of hiding the card,
so it is clear these were checked rather than left out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Tighten ZHA network health findings

- Leave out devices disabled in the device registry
- Only report "Setup not finished" when the entity registry knows no entity
  of the device either: the device list only carries entities that were
  added, so a device whose entities are all disabled looked unfinished
- Show "via <router>" for end devices only
- Only offer firmware updates for devices that are online
- Sort with the user's language, as the neighbouring pages do
- Undo unrelated reformatting of en.json from an earlier commit

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Skip configuration entities when picking a device icon

A child lock switch made a smart plug show a lock icon.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Address review feedback on the network health page

- Only an end device's current parent sets its neighbour-table link;
  a former parent's stale entry no longer overrides the last packet
- Check for registered entities against the full entity registry, so
  devices whose entities are all disabled are not shown as unfinished
- Resolve areas through the device registry (getZHADeviceAreaName)
- Group subpage lists by area, worst reading first within a room
- Hide "Worth a look" when there is nothing to show

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Link firmware update rows to the device page

The ZHA device page has no install control for the update entity.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Reload the entity registry with every device refresh

A device that joins while the page is open was matched against the
registry from when the page opened and shown as setup not finished.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep finding values in the secondary text color

Warning-colored text has too little contrast on the light theme; the
icon in front of each row still carries the color.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Color the low battery icon and localize the LQI label

The slot rule for row icons outranked the warning color, so the
battery icon stayed grey.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Rework the network health page after review

- Consume contexts instead of hass; the entity registry comes from
  fullEntitiesContext, so it is no longer fetched on every refresh
- Localize with full keys, format numbers with formatNumberWithUnit,
  use theme tokens for radii and line heights
- Drop the firmware update finding; updates have their own place
- Hide the attention card and empty legend items when there is nothing
  to show
- Subpages get a tip below the card and a Show map button
- Move the dashboard dot to the start of the description line

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Leave disabled devices out of the network snapshot

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Address review: theme colour, localized strings, kebab-case subpage URLs

- Use --ha-color-green-70 for "fair" instead of mixing with white
- "Updated {relative_time}" with ha-relative-time as the value
- LQI value via placeholder instead of string concatenation
- Subpage URLs in kebab-case via slugify(key, "-")

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-11-24 15:32:39 +01:00
Paul Bottein 56bd78dae5 Change cover state color to blue (#56086) 2026-11-24 10:08:26 +01:00
Andrew MikofalvyandClaude Opus 5.5 a78812d4d6 Finish the Matter add-device dialog after recommissioning a known device (#55987)
* Finish the Matter add-device dialog after recommissioning a known device

Core merges a recommissioned node into the existing device that shares
its serial number, so no new device ID appears and the dialog stayed on
its spinner. Watch for a new Matter node identifier instead, on a new
device or an existing one.

For a device that existed when the dialog opened, offer the device class
of an entity created since then, not one left by an earlier node, and do
not prefill the name typed in the companion app, which would rename the
existing device and its entity IDs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Name the Matter node identifier prefix after its source in core

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Only rename the new node's entities when finishing on an existing device

On a recommissioned device, a name typed in the last step renamed every
entity on the device, including those of earlier nodes that automations
use. Limit the rename to entities created since the dialog opened, like
the device class picker. watchForNewMatterDevice now reports whether the
device existed, so the dialog no longer keeps its own device snapshot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-24 08:08:45 +02:00
Dusan Cervenka 08641f2ac0 Start an optional Kelvin value inside the targeted lights' range (#55957)
Use the slider minimum when an optional Kelvin field is enabled.

The fallback helper already owns the value a selector displays, so the service form no longer special-cases color temperature.
2026-11-24 07:53:44 +02:00
renovate[bot] 0de4f6212c Update babel monorepo to v8.1.3 (#56095)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-23 22:53:30 +00:00
WendelinandClaude 1ecbda0567 Fix cut-off emergency kit description in backup dialogs (#56079)
Wrap emergency kit description in backup encryption key dialogs

The emergency kit row in the backup encryption key dialogs truncated
its description to a single line, so longer translations (for example
French) were cut off next to the download button and could not be read.
Use the wrap-supporting-text attribute of ha-row-item so the full
description wraps onto additional lines.

Fixes #56055


Claude-Session: https://claude.ai/code/session_018Kv7eFKn8kWVuYnKUdaRso

Co-authored-by: Claude <[email protected]>
2026-11-23 23:10:43 +01:00
Jan Bouwhuis ce97427f46 Announce the state of network graph toggle buttons (#56083)
* Announce the state of network graph toggle buttons

* Remove cost_adjustment_day from the grid net cost test

* Make ariaPressed of ha-icon-button property-only
2026-11-23 19:49:49 +01:00
Petar Petrov c5b2c965bd Hide the history panel zoom bar until the charts are zoomed (#56087)
* Hide the history panel zoom bar until the charts are zoomed

* Keep the hidden history zoom bar in the tab order
2026-11-23 15:52:16 +00:00
Jan Bouwhuis 27fc38b3bf Give chart control buttons a square frame and highlight (#56081)
* Give chart control buttons a square frame and highlight

* Remove cost_adjustment_day from the grid net cost test
2026-11-23 15:37:20 +01:00
renovate[bot] 9ec8d0ec6f Update pnpm to v12.22.0 (#56084)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-23 14:34:32 +00:00
Lex PostmaandClaude Opus 5.5 e0423fd81e Remove cost_adjustment_day from the grid net cost test (#56080)
#55883 removed `cost_adjustment_day` from grid sources, but the test
fixture added in #53992 still set it, so the type check failed on dev.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-23 13:40:25 +00:00
Raphael HehlandYosi Levy f08e3b299e Drag picture elements placed from the right or bottom (#55871)
* Drag picture elements placed from the right or bottom

* Keep moved sides behind an empty inset

---------

Co-authored-by: Yosi Levy <[email protected]>
2026-11-23 15:17:34 +02:00
WendelinandClaude Opus 5.5 089ddb9ade Add a camera player with its own controls to the more info (#56013)
* Add a camera player with its own controls to the camera more info

Prototype of a live view that looks and behaves the same in every
browser, instead of each browser's native video controls:

- Controls fade out after a few seconds and come back on hover, tap or
  focus: sound on the bottom start, picture in picture and full screen on
  the bottom end, reset zoom on the top end once zoomed in.
- Zooms with the scroll wheel, a pinch or a double click and pans by
  dragging. With wheel-zoom="modifier" the wheel only zooms while ctrl or
  cmd is held, so a dashboard around the player keeps scrolling.
- A badge on the top start shows the stream protocol, while it connects,
  and when WebRTC still connects in the background while HLS plays. It
  opens a dialog that explains WebRTC, HLS and MJPEG.
- MJPEG streams play in a video through a canvas, so they can also be
  shown picture in picture.

WebRTC streams now always keep their audio track, so a muted stream can
be unmuted again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ5kMnYuXaDsfPLh4h

* Clean up the camera player when it is removed

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ5kMnYuXaDsfPLh4h

* Only zoom the camera player with ctrl or cmd and the scroll wheel

The scroll wheel alone now always scrolls the page around the player,
in the more info dialog just like on a dashboard. A hint over the player
shows which key zooms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ5kMnYuXaDsfPLh4h

* Drop the info icon from the camera stream badge

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ5kMnYuXaDsfPLh4h

* Show the camera zoom hint as a small pill at the top end

It takes the place where the reset zoom button comes once zoomed in,
instead of covering the whole picture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ5kMnYuXaDsfPLh4h

* Keep the bottom sheet still while panning a zoomed in camera

Dragging a zoomed in camera picture pans it, but the more info bottom
sheet also took the drag and moved or closed. The zoomed in picture now
locks the sheet's swipe, like other controls that drag on touch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ5kMnYuXaDsfPLh4h

* Keep the stream badge and the muted button over the camera picture

The connection badge now always shows, and so does the sound button
while a stream with sound is muted, so it is clear there is sound to
turn on. The other controls still fade out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ5kMnYuXaDsfPLh4h

* Fix MJPEG in the camera player, open stream info at the top

- An MJPEG stream never finishes loading, so some browsers never report
  the image as complete and the player kept connecting. It now only
  waits for a first frame, and shows the image itself when no frame
  could be copied within a few seconds.
- The stream badge fades with the other controls again once connected,
  only the muted sound button stays.
- The stream info dialog opens at the top like the more info dialog,
  and as a bottom sheet on small screens.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ5kMnYuXaDsfPLh4h

* Keep the bottom sheet still while pinching in it

A pinch starts with one finger, which the bottom sheet already took as a
swipe, so zooming a camera picture with two fingers also moved the
sheet. A second finger now stops the swipe and puts the sheet back.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ5kMnYuXaDsfPLh4h

* Show MJPEG streams as an image again, fold away unsupported streams

- The MJPEG player now shows the image itself, like before, which
  works in every browser. Only a hidden video plays a copy of it, for
  picture in picture. Until the first frame it keeps the room of a
  picture, with the camera's preview if there is one, so nothing
  jumps. The player also no longer looked at the wrong image and kept
  connecting.
- The stream info dialog lists the streams the camera can't use below
  the others, folded away.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ5kMnYuXaDsfPLh4h

* Give the unsupported streams in the stream info more room

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ5kMnYuXaDsfPLh4h

* Keep the screen on while the camera more info is open

A live camera view shouldn't turn dark while watching it, and an image,
like an MJPEG stream, never keeps the screen on. The player now holds a
screen wake lock with keep-awake, and requests it again when the page
shows again, as browsers release it when the page is hidden.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ5kMnYuXaDsfPLh4h

* Fix MJPEG loading, panning it with a mouse and full screen layout

- The MJPEG stream image now shows over the camera's preview while it
  loads, instead of loading hidden, which some browsers never do. Where
  a browser doesn't tell when the first frame arrived, it counts as
  connected after a few seconds.
- Dragging the MJPEG image with a mouse started the browser's image
  drag instead of panning the zoomed in picture.
- Full screen centers the picture and keeps it and the controls clear
  of notches and rounded corners.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ5kMnYuXaDsfPLh4h

* Load only the MJPEG stream, like before, not also its preview

Showing the camera's preview while an MJPEG stream loaded also fetched
a snapshot at the same time. For cameras whose MJPEG stream Home
Assistant makes from snapshots, this kept the stream from loading. The
player now only requests the stream, like before, with an empty space
of a picture's size until its first frame.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ5kMnYuXaDsfPLh4h

* Load MJPEG streams from the Home Assistant URL

The MJPEG stream path was used as is, so it loaded from wherever the
frontend is served instead of from Home Assistant, unlike HLS. With
the frontend served on its own, like with script/develop_and_serve,
the stream never loaded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ5kMnYuXaDsfPLh4h

* Only play the MJPEG video for picture in picture, fix its state

- The hidden video that copies an MJPEG stream now only plays while
  picture in picture is open, instead of all the time. It costs no
  battery otherwise, and browsers don't offer picture in picture for it
  on their own. Streams from another origin, which can't be copied,
  have no picture in picture button.
- document.pictureInPictureElement only gives the outermost shadow host,
  so the player never knew picture in picture was open. It now follows
  the events of the video.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ5kMnYuXaDsfPLh4h

* Drop the MJPEG loaded timeout, it only hid the wrong stream URL

The stream did load in every browser, it only came from the wrong URL
with the frontend served on its own. The player now only counts a
stream as connected once its first frame arrived.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ5kMnYuXaDsfPLh4h

* Only explain MJPEG in the stream info while it shows

MJPEG is only the fallback of a camera's video streams, so the stream
info now only lists it while it shows: with a note when the video
streams failed, or as all there is for a camera without a video stream,
without listing the video streams it doesn't have.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ5kMnYuXaDsfPLh4h

* Add a zoom minimap and a play button, fix review findings

- While zoomed in, a minimap next to the reset zoom button shows the
  whole picture and the part in view, so it is clear the zoom is
  digital. It fades with the other controls.
- A play button shows while the stream was paused from outside, like
  in the picture in picture window or the iPhone's own full screen
  player, which had no way back before.
- While the Android app plays an HEVC stream in its own player, the
  camera player only shows the stream, as its controls and zoom can't
  reach the app's player.
- A failed MJPEG picture in picture stops copying frames again.
- The controls stay while one of them has keyboard focus.
- A mouse released outside of the player no longer keeps its press,
  pinching stays under the fingers, and a resize keeps the same part
  of a zoomed in picture in view.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep an MJPEG stream connected when the more info comes back

When coming back from the history, the camera stream started over
while the MJPEG player kept its picture and never told it again, so
it stayed connecting.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Use theme tokens for the camera overlay colors and timings

The overlay uses the white color and focus ring tokens. The tokens need
no fallback, and their durations already turn off motion when reduced
motion is preferred.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Use the list components in the stream info dialog

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Show the play button when autoplay is blocked, reconnect MJPEG streams

- When a browser blocks playing even muted, the play button shows, as
  it is the only way left to start the stream.
- Lifting one finger of a quick pinch no longer counts as a tap that
  toggles the controls.
- While Home Assistant is disconnected, the stream shows as connecting.
  An MJPEG stream loads again once it is back, after a restart, or when
  the more info comes back, and counts as connected at its first frame.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Load an MJPEG stream again also before its first frame

When the connection came back before the first frame, nothing changed
for the player, so it never set the stream's source again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
2026-11-23 14:16:10 +01:00
50c911fe2f Add dynamic period cost indicator chip to Energy Usage Graph (#53992)
* Add dynamic period cost indicator chip to Energy Usage Graph

- Evaluates configured grid energy sources to compute period net cost from cost statistics or fixed rates.
- Factors in export compensation (stat_energy_to / stat_compensation / number_energy_price_export) matching hui-energy-sources-table-card.
- Displays a dedicated <hui-energy-graph-chip> in the card header formatted with user's currency.
- Gracefully omitted when no cost data or fixed prices are configured.

* Share grid net cost with the sources table and address review

Use the cost statistics for the period only, so the chip matches the
sources table total. Drop the fixed-price fallback and the English
fallback string, format the cost once, and label the tooltip as net grid
cost.

---------

Co-authored-by: kdvlr <[email protected]>
Co-authored-by: Petar Petrov <[email protected]>
2026-11-23 12:52:25 +00:00
Lex PostmaandClaude Opus 5.5 bf16d4e5a1 Refresh related filters after an edit and keep broken helpers in filters (#56039)
Refresh related filters on return and keep unassigned helper entries

The config list pages are kept by the router while an item is edited, so
the device, area, entity and blueprint filters kept the related items they
found before the edit. Look them up again when the page is shown again.

Helper config entries that failed or are still setting up have no entity,
so any filter hid them. They now count as items with nothing assigned:
"No area" keeps them, a selected id leaves them out.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-23 13:46:31 +01:00
g2ti98fl6zs023is 608ad23071 Resume suspended reconnects when WebView wake events are missing (#55975)
* Resume reconnects when WebView wake events are missing

* Create when-document-visible.ts

* Create when-document-visible.test.ts

* Prevent detached app instances from restarting reconnect suspension

* Remove unnecessary app-root detach handling

* Test visibility recovery callback directly
2026-11-23 12:41:09 +00:00
WendelinandClaude Opus 5.5 0d84bb01ec Make switches and buttons follow custom theme colors (#56077)
* Apply picked colors to custom themes that don't set them

Primary and accent colors picked in the profile only applied to the
default theme. A custom theme that only changes a few variables, like
the background, fell back to the default blue palette with no way to
pick another color. Picked colors now also apply to custom themes that
don't set that color in the active mode. Colors and palette keys the
theme sets itself still win.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJQTzwTG2xkvxUNQZg

* Explain theme mode and colors set by the theme instead of hiding them

The theme mode selector and the color pickers were hidden for themes
that don't support them, so users couldn't tell why the options were
missing. Both now stay visible. When the theme fixes the mode or a
color, the control is disabled, shows the value the theme uses, and a
line of text names the theme as the reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJQTzwTG2xkvxUNQZg

* Show theme explanations and palette-only primary in theme settings

The explanation text was rendered into the supporting-text slot after
the first render, which the list item doesn't pick up, so it never
showed. Use the supportingText property and let it wrap. A theme that
only sets the primary palette now shows its base palette color in the
disabled primary picker instead of the default blue.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJQTzwTG2xkvxUNQZg

* Fix theme casts in the apply themes test

The test theme literals don't have the keys the Theme type lists, so
the type check rejected the direct casts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJQTzwTG2xkvxUNQZg

* Color the set by theme explanation as a warning

Make the text that explains why theme mode or colors can't be changed
stand out from the regular description, using the semantic warning
text color so it stays readable in light and dark mode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJQTzwTG2xkvxUNQZg

* Generate the primary palette from a custom theme's primary color

A custom theme that set primary-color without the palette kept the
default blue palette, so switches, buttons and other components using
the palette ignored the theme color. Generate the palette and the
light, dark and darker primary shades from the theme's primary color
when the theme doesn't set any palette key. Keys the theme sets itself
still win. State icons and text on primary are left alone, so existing
themes don't get their entity icons recolored. Colors that can't be
parsed, like var() references, are skipped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJQTzwTG2xkvxUNQZg

* Normalize the luminance of theme primary colors for the palette

A theme with a near black primary color, common in older themes that
used it for the header, got a near black palette, so switches, buttons
and links became hard to see in dark mode. Normalize the color before
generating the palette, the same as colors picked by the user. The
theme's own primary-color stays as it is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJQTzwTG2xkvxUNQZg

* Name the darkest generated palette shade 05

The generated palette named its darkest shade ha-color-primary-5, but
components use ha-color-primary-05, so that shade kept the default blue.
Quiet primary fills in dark mode didn't follow the picked or theme color.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Reword the set by theme explanations and use secondary text color

Start the explanations with the theme name, so names that end in
"theme" don't read as "the ... theme theme". Show them in the semantic
secondary text color instead of warning orange, since they explain
rather than warn.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Quote the theme name in the set by theme explanations

Quoting the name marks it as a name, so theme names that end in "theme"
read fine, and keeps the wording consistent with other strings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Drop "the ... theme" around the quoted theme name

The quotes already mark the name, so the extra words only made names
that end in "theme" read twice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Trim comments and reuse existing color and localize helpers

Use cssColorToHex instead of a local formatHex wrapper, consume
localize directly instead of the whole internationalization context,
and drop comments that only restate the code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Only tint the dark mode header for the default theme

Picked colors now also apply to custom themes, which also tinted their
dark mode header. Keep that tint on the default theme, so custom themes
keep the header they had before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
2026-11-23 13:32:45 +01:00
Raman GuptaandClaude Opus 5.5 ff95b531b7 Use the latest arguments for throttle's trailing call (#55962)
The trailing call captured the arguments of the call that scheduled the
timer, so calls made later in the same window were dropped. Keep the
latest arguments and use them when the timer fires.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-23 13:21:00 +01:00
Maarten Lakerveld 921b7362a5 Keep the Marketplace name out of translations (#55882)
* Keep the Marketplace name out of translations

Marketplace is a product name, so translators should not change it. The
name now lives in MARKETPLACE_NAME: titles use it directly and sentences
get it through a {marketplace} placeholder. The panel title, Settings
entry, and repository page header no longer have translation keys.

* Fill the Marketplace name inside localize

Every string with {marketplace} needed its caller to pass the name, and a
forgotten caller turns the string into a translation error. localize now
merges NAME_PLACEHOLDERS under the caller's values, so the callers only
pass what varies.
2026-11-23 12:01:18 +00:00
Luca Félix fb20d72938 Keep the radius when editing a location selector's coordinates (#55765)
* Keep the radius when editing a location selector's coordinates

The form handler emitted radius: NaN when the value had no radius yet,
and dropped a read-only radius.

* Test the location selector's form value as a pure function

Rendering tests are out of scope for the frontend tests, so building the
value moves to computeLocationFormValue and is tested directly.

* Address location selector review feedback

Keep a read-only radius unrounded, fall back to the default radius the
map shows, and move the helper into its own module as
computeLocationSelectorValue.

* Keep a cleared location selector radius empty

Apply the default radius only when the value never had one, so clearing
the field no longer snaps it back to the default. Share the default
radius constant with the selector.
2026-11-23 13:13:39 +02:00
4a1328970f Return null from parseAspectRatio for unhandled formats (#55969)
* Return null from parseAspectRatio for unhandled formats

parseFloat stops at the first character it can't parse, so input such as
16/9 or 16X9 was read as 16 and returned a 16:1 ratio instead of null.
Match the supported formats in full instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Return null from parseAspectRatio for non-string input

YAML loads an unquoted aspect_ratio: 16:9 as the base-60 number 969.
The regex coerced it to "969" and returned a 969:1 ratio, where the
previous code threw on it and returned null.

Co-Authored-By: MindFreeze <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: MindFreeze <[email protected]>
2026-11-23 12:10:41 +01:00
Raman GuptaandClaude Opus 5.5 f441726c3c Accept a single visibility condition mapping in dropInvalidConditions (#55966)
A visibility written as a single mapping instead of a list reached the
for...of loop as a plain object and threw a TypeError. Wrap it in an
array, as nested conditions already are.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-23 12:53:39 +02:00
BenV 731fd30b07 Stop the user badge from updating on every state change (#56029)
* Stop the user badge from updating on every state change

* Derive the person picture in render and handle a loading registry
2026-11-23 11:53:07 +01:00
Aidan TimsonandCopilot Autofix powered by AI b6660a23ed Don't hold the launch screen when the first panel redirects (#56072)
* Wait for the panel that replaces one before it was ready

* Modify event listener for 'hass-panel-ready'

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
2026-11-23 11:41:52 +01:00
Lex PostmaandClaude Opus 5.5 f3990796ba Announce partly selected list options to screen readers (#56041)
* Announce partly selected list options to screen readers

A list option with `indeterminate` set draws a mixed checkbox, but the
row (role `option`) only exposed `aria-selected` and the checkbox sits in
an inert wrapper, so screen readers read the row as not selected. Add a
localized "Partly selected" `aria-description` while the row is
indeterminate, and remove it again when it no longer is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Remove the rendering test for the partly selected description

The frontend testing guidance rules out rendering tests for components
that only put context data into their output.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Document the indeterminate option in the list gallery page

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-23 11:07:13 +01:00
Jan Čermák 4fb7eefb27 Pin home-assistant/actions to the 2026.11.0 tag (#56075)
Switch the home-assistant/actions steps in release.yaml from the master
SHA pin to the 2026.11.0 release tag. The tag points to the same commit
(07f46fd), and actions.lock pins it there.
2026-11-23 11:05:40 +01:00
renovate[bot] 214762a052 Update dependency @lezer/common to v1.5.6 (#56074)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-23 11:26:37 +02:00
Petar Petrov a75f7265ff Fix history graph holding a stale value after a burst of readings (#56073)
* Keep the last reading of a downsampled frame before a long hold

* Avoid Array.at in the down-sample test
2026-11-23 10:12:11 +01:00
G JohanssonandClaude Opus 5.5 3a5c534def Translate attribute values of groups with their members (#56051)
* Translate attribute values of groups with their members

A group entity, such as a light group, has no translations or icons for
the attribute values of its members, for example light effects. When a
group has no translation or icon for a value, use the one of a member of
the same domain that has it. A member's default icon is not used.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Skip group members without a platform for attribute icons

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Use group_entities for the members of a group

Find the members with computeGroupMemberIds, which also reads the
group_entities attribute of groups from integrations.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Use the range icons of group members

A member can define icons for numeric attribute values with ranges.
Use them in the member fallback too, without the default icon of the
member.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Continue the group icon lookup when a member's icons fail to load

A failed request for the icons of a member stopped the whole lookup, so
the other members and the domain fallback were not tried.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Share the group member filter of attribute translations and icons

Move the filter of group members with translations into
computeGroupMemberEntries next to computeGroupMemberIds, so the attribute
value translation and the attribute icon use the same rule. The
translation lookup now also skips members without a platform.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-23 11:09:00 +02:00
Lazizbek Ergashev ebd2842493 Sort solar forecast points by time (#56059) 2026-11-23 06:32:20 +00:00
renovate[bot]andSimon Lamon 177eaff888 Update formatjs (#56050)
* Update formatjs

* Push test

* Downgrade datetimeformat

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Simon Lamon <[email protected]>
2026-11-23 08:22:27 +02:00
renovate[bot] 02a580815b Update release-drafter/release-drafter action to v7.11.0 (#56069)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-23 08:20:19 +02:00
renovate[bot] b9c454e99b Update peter-evans/create-pull-request action to v8.1.3 (#56067)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-23 06:53:39 +01:00
renovate[bot] b5d65cd8e0 Update home-assistant/actions digest to 07f46fd (#56066)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-23 06:53:14 +01:00
renovate[bot] ec2f78471c Update dependency github/gh-actions-lock to v0.5.1 (#56065)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-23 06:52:58 +01:00
renovate[bot] 9eb51a8c06 Update dependency github/gh-actions-lock to v0.5.0 (#56057)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-22 11:34:01 +02:00
renovate[bot] d32d637ba3 Update dependency @webcomponents/scoped-custom-element-registry to v0.0.11 (#56056)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-22 08:18:19 +02:00
renovate[bot] 113f90eb8d Update vitest monorepo to v5.1.1 (#56053)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-21 14:27:02 +02:00
renovate[bot] c66d41d84b Update dependency intl-messageformat to v12.2.0 (#56049)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-20 17:29:35 +02:00
renovate[bot] 76d225f5ce Update dependency maplibre-gl to v6.19.0 (#56047)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-20 17:29:25 +02:00
Bram Kragten 1ea5f1ab4f Bumped version to 20261028.8 2026-11-20 15:42:39 +01:00
Bram Kragten bbd745d901 Stop camera streams right away when hidden in the companion apps (#55887) 2026-11-20 15:41:02 +01:00
WendelinandClaude Opus 5.5 6eef60dc57 Add hac-spinner and name loading spinners for screen readers (#56030)
* Give ha-spinner a translated, overridable accessible name

wa-spinner always names its progressbar with an untranslated "Loading" and ignores the host's aria-label, so every spinner was announced in English and labels set by callers never reached screen readers. Render the same template, but use the host's aria-label when given and the translated "Loading" otherwise.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ6ew6Qshqh75jaoaL

* Translate spinner labels in the data disk and card/badge editors

These aria-labels were hard-coded English. They had no effect before, but ha-spinner now exposes them, so they must be translated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ6ew6Qshqh75jaoaL

* Document how to label ha-spinner in the gallery

Explain that spinners are announced as "Loading" by default, how to name what is in progress, and to use ha-button loading for button actions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ6ew6Qshqh75jaoaL

* Translate the loading label in the gallery

The gallery's stand-in localize echoes unknown keys, so spinners there were named "ui.common.loading".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ6ew6Qshqh75jaoaL

* Use accessibleLabel to name ha-spinner

Match ha-input, ha-badge and the Web Awesome components, which take accessible-label. Taking aria-label put the name on the role-less host as well as on the progressbar, and overrode the native ariaLabel property.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ6ew6Qshqh75jaoaL

* Make ha-spinner a standalone component

ha-spinner extended wa-spinner but replaced its template, so it only used the base for its styles. Make it a plain LitElement with the same template, look and API (size, accessible-label, --ha-spinner-* variables), and improve its accessibility:

- aria-hidden on the host is passed on to the progressbar, because in Chromium the host's aria-hidden alone doesn't keep "Loading" out of a parent's name.
- In forced colors mode, the track and arc use system colors so they stay visible.

Size presets now come from CSS, which also fixes removing size: it cleared --ha-progress-ring-size and left the old preset in place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ6ew6Qshqh75jaoaL

* Add hac-spinner and base ha-spinner on it

Move the spinner into @home-assistant/components as <hac-spinner>, with the same look and accessibility as ha-spinner: an indeterminate progressbar named with accessible-label, aria-hidden passed on to it, system colors in forced colors mode and no animation with reduced motion.

Its theme variables fall back from --hac-spinner-* to the ha-spinner variables and then the semantic tokens, like hac-card. Its default name is "Loading", which a subclass can replace.

ha-spinner stays as a subclass that only translates that default name, so existing usages keep working unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ6ew6Qshqh75jaoaL

* Size hac-spinner without em

Resolve the size into --_size and use it directly, instead of setting it as the font size and measuring in em, which the codebase doesn't use.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ6ew6Qshqh75jaoaL

* Fix tests and gallery build for hac-spinner

Vitest didn't use the ha-source export condition, so it resolved @home-assistant/components/spinner/scoped to the unbuilt dist and every test importing ha-spinner failed. Use the condition like tsconfig.json and the app build do.

The gallery turns markdown into a template literal, so the ${} in the spinner page's code example was evaluated and broke the gallery build and type check. Show the attribute form instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ6ew6Qshqh75jaoaL

* Keep ha-spinner's sizing, hiding and legacy variables

Address review feedback on hac-spinner compatibility with ha-spinner:

- A size preset wins over --ha-spinner-size again, as when ha-spinner set it inline, so a theme-wide value can't resize a tiny spinner.
- hidden is !important, as in Web Awesome, so it still hides a spinner styled with display: block.
- --indicator-color, --track-color and --speed set on the element work again; like --track-width they are set on the host, so ancestor values don't leak in.

Also hide the ZHA add devices spinner from screen readers, since the heading above it already says the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ6ew6Qshqh75jaoaL

* Keep the base part and tidy spinner docs

Expose the svg as part base too, like wa-spinner did, so ha-spinner::part(base) styles from custom cards keep matching. Fix the ha-spinner doc comment, where accessible-label isn't "as before", and drop the gallery sentence the Accessibility section already covers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eJ6ew6Qshqh75jaoaL

---------

Co-authored-by: Claude <[email protected]>
2026-11-20 15:38:19 +01:00
Bram Kragten 5d481a77b9 Bumped version to 20261028.7 2026-11-20 14:08:00 +01:00
Jan Bouwhuis ccc750b5a9 Align MQTT subscribe card width with other cards (#55914) 2026-11-20 14:07:42 +01:00
Simon LamonandPetar Petrov 3a31fdca87 Fix getWeatherExtrema when either is 0° (#55687)
* Fix getWeatherExtrema when either is 0°

* Update src/data/weather.ts

Co-authored-by: Petar Petrov <[email protected]>

* Simplify tempLow assignment conditions

Refactor temperature low assignment logic in weather.ts

* Prettier

* Apply suggestion from @MindFreeze

Co-authored-by: Petar Petrov <[email protected]>

---------

Co-authored-by: Petar Petrov <[email protected]>
2026-11-20 14:07:40 +01:00
Clément Notin b2efa6f989 Disable Corepack download prompt in devcontainer (#56038) 2026-11-20 12:34:05 +01:00
Misha Hawthorn 98cc0046f4 Don't animate camera image spinners while off-screen (#56043)
hui-image only fetches a camera snapshot once its card scrolls into view, but it rendered the loading spinner regardless. An off-screen camera card therefore kept an infinite spinner animation running, forcing a style, layout and paint update every frame. With several cameras below the fold this pinned a CPU core in the iOS/macOS companion app's web view.
2026-11-20 09:45:13 +00:00
renovate[bot] e37bce3277 Update dependency @rspack/core to v2.3.3 (#56045)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-20 09:36:38 +00:00
Lex PostmaandClaude Opus 5.5 26c8e6db15 Announce the selected button in ha-button-toggle-group (#56042)
The toggle group only showed the active button through its colour, so
screen readers could not tell which option was selected.

ha-button now forwards aria-pressed to its inner button, the element that
gets focus, in the same way wa-button forwards aria-label. The toggle group
sets it on each button, inside the existing wa-button-group role="group".

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-20 09:35:24 +00:00
Lex PostmaandClaude Opus 5.5 160cfc7828 Nest the Status filter options in pairs and tick the areas of a ticked floor (#56032)
* Nest the Status filter options like floors and areas

The Status filter of the entities page lists its opposite options under a
row for each pair, like areas under their floor in the Areas filter: Available
and Unavailable under Availability, Enabled and Disabled under Activation, and
Visible and Hidden under Visibility. A pair row ticks or unticks both, and is
partly ticked while only one of them is. Every option has an icon, matching
the status column and the actions for the selected entities.

Available and Unavailable are now exact opposites: entities without a state,
which are the disabled ones, count as unavailable. The hidden Availability
column, used for grouping and sorting, matches the filter.

In the Areas filter a ticked floor shows its areas ticked. Unticking one of
them keeps the others and leaves the floor partly ticked, and ticking the last
area of a floor picks the floor again. The filter value and its links don't
change. Only the list scrolls now, instead of the list and its container.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Untick listed areas of a floor and keep empty states available

Unticking an area of a ticked floor kept it ticked when an older filter
value listed the floor and that area. An entity with an empty state,
such as a cleared text helper, counted as unavailable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Match a floor and all its areas the same, and count floor targets per area

On Automations and Scripts, ticking every area of a floor picks the floor,
whose search also finds what targets the floor directly, while a search for
each of its areas doesn't. So the same ticked checkboxes could give
different results.

- The Areas filter now looks a picked floor up as its areas, so a floor and
  all its areas always match the same.
- An automation or script that targets a floor counts for each area on that
  floor, as it acts on all of them. Ticking only the Kitchen also shows the
  automations that target the whole ground floor.
- To tell what targets a floor itself, the floors of the picked areas and
  their other areas are looked up too, for automations and scripts only.
  Other tables have nothing that targets a floor directly.
- The value stays `{ floors, areas }`, so links and stored filters keep
  working.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Find what targets a floor only when the whole floor is picked

Telling what targets a floor directly by taking out what its areas' searches
find missed automations and scripts that target a floor and also name one of
its areas. Search results can't tell those apart, so floors are looked up
whole again: a floor, or a floor whose areas are all picked, uses the floor
search, which also finds what targets the floor itself. Areas picked without
their whole floor use the area search.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Look the floors and areas up again when they change

Whether a floor is picked whole depends on which areas it has, so when an
area is added to a floor or moved to another one, the Areas filter looks
its picks up again instead of keeping the items of the old layout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-20 09:24:30 +00:00
renovate[bot] 46db541153 Update dependency typescript-eslint to v8.73.0 (#56036)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-20 08:23:46 +02:00
renovate[bot] 4d8eca2229 Update dependency marked to v18.2.1 (#56034)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-19 20:38:23 +01:00
renovate[bot] 7fff78c391 Update dependency browserslist to v4.29.6 (#56033)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-19 20:38:16 +01:00
renovate[bot] b2405df91b Update dependency home-assistant-js-websocket to v9.9.0 (#56031)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-19 20:25:43 +02:00
Petar Petrov 01dac9b1e7 Exclude states after the selected end from history export (#56024) 2026-11-19 17:30:59 +01:00
Bram KragtenandClaude Opus 5.5 ca5eed92b8 Show the energy collection key prefix in the card editors (#56025)
* Show the energy collection key prefix in the card editors

The collection key of energy cards must start with "energy_", which
users had no way of knowing. The editors now show "energy_" as a fixed
prefix in the field, so only the part after it is typed.

ha-input gets inputPrefix and inputSuffix. With a label, a prefix uses
the inset label layout of the entity ID field. The text selector, the
multi input, the dialog box and the entity ID field now use them
instead of their own slotted spans.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Always add the collection key prefix

Only adding "energy_" when it was missing rewrote a valid key such as
"energy_energy_custom" to "energy_custom" whenever another field in the
editor changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep an empty collection key on the default collection

An empty collection key means the default collection, but editing any
other field in the editor saved it as "energy_", a separate collection.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-19 17:26:58 +01:00
WendelinandClaude Opus 5.5 9758bcd750 Expose label menu checked state to screen readers (#56027)
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Claude <[email protected]>
2026-11-19 17:07:42 +01:00
Erwin DounaandCopilot Autofix powered by AI 16103b7759 Suggest energy meters that aren't configured (#55735)
* Suggest energy meters that aren't configured

* Address review feedback

* Address review feedback

* Simplify energy meter suggestions

* Offer individual device for gas and water suggestions

* Fix grid pairing and dismiss sync

* Open the source editor from a suggestion

* Keep pending dismissals across subscription updates

* Address review feedback

* Refactor gas unit class condition for suggestions

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* Revert "Refactor gas unit class condition for suggestions"

This reverts commit 38b26e46a2.

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
2026-11-19 17:18:45 +02:00
Bram KragtenandClaude Opus 5.5 3bd7c6363b Add ha-list-item-switch for settings rows with a switch (#56023)
* Add ha-list-item-switch for settings rows with a switch

The whole row is the label of the switch, so clicking anywhere on it
toggles the switch and the row text names it for screen readers. Rows
that only had a switch at the end now use it instead of an ha-switch
with a hand-written accessibleLabel.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Name switch rows by their headline only

The switch in ha-list-item-switch was named by its whole label, so the
supporting text became part of the name. Use a native switch input in
the row's own shadow root, labelled by the headline and described by
the supporting text, and keep ha-switch only to show the state.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-19 16:06:07 +01:00
WendelinandClaude 0ec07be0c5 Give dashboard and to-do controls an accessible name (#56022)
Co-authored-by: Claude <[email protected]>
2026-11-19 15:41:43 +01:00
Bram KragtenandClaude Opus 5.5 848d75c5d3 Simplify the onboarding location announcements (#56017)
* Simplify the onboarding location announcements

- Announce the selected place with its display_name instead of building
  the label in a separate helper.
- Route list and marker clicks through one _selectPlace.
- Show the plain no-match text in the empty results row, like pickers
  do, so the search term doesn't need its own state.
- Drop aria-busy on the results list.
- Don't search on Enter in an empty field.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Remove unneeded comment

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-19 15:27:56 +01:00
WendelinandClaude b88233031e Give automation editor checkboxes an accessible name (#56019)
Give automation editor switches and checkboxes an accessible name

The optional field checkboxes in actions, triggers, conditions and
integer form fields, the target picker selection checkbox and the
automation state switch in the automation list had no accessible
name. Label each with the field, target or automation name.


Claude-Session: https://claude.ai/code/session_018Kv7eJ7eDkVF2sM4WjguEm

Co-authored-by: Claude <[email protected]>
2026-11-19 15:27:29 +01:00
Maarten Lakerveld 50ebbf9a49 Give dialogs an accessible name for screen readers (#56003)
* Give the more-info and Assist dialogs an accessible name

Add accessibleLabel to ha-adaptive-dialog and ha-bottom-sheet. The bottom
sheet passed aria-labelledby="ha-dialog-title" to wa-drawer, but that id
lives in another shadow root, so sheets had no name even with a header
title. Pass the title text as the drawer label instead.

Label more-info with its visible title and Assist with "Assist".

* Give the remaining dialogs an accessible name

Dialogs that put their title in a slot or a custom header now pass it as
accessibleLabel: the dashboard editors, the media dialogs, the config
flow, add automation element, the quick bar, and a few config dialogs.

ha-drawer gets accessibleLabel too, so the mobile sidebar and the
notification drawer are named.
2026-11-19 14:11:55 +00:00
Maarten Lakerveld f09e39fcbe Make the onboarding location search usable with a screen reader (#56005)
Enter on a search result or in the country picker no longer finishes
the step: the host-wide Enter listeners in onboarding-location and
onboarding-core-config are gone, so only the Next button saves.

A polite status region announces the result count, no results, and the
selected place. The visible "No results" text is localized.

The search field becomes readonly instead of disabled while searching,
so it keeps focus. Pressing the search or detect button moves focus to
the field with select(), because focus() on ha-input is a no-op while
its slotted button holds focus, and the button is replaced by a spinner.
2026-11-19 14:11:38 +00:00
WendelinandClaude 300ffc051f Give data table selection checkboxes an accessible name (#56015)
The select-all checkbox in the header and the selection checkbox in
each row had no accessible name. Label the header checkbox "Select
all" and each row "Select {name}" from the row's main column, with
"Select row" when the main column has no plain text value.


Claude-Session: https://claude.ai/code/session_018Kv7eJ7eDkVF2sM4WjguEm

Co-authored-by: Claude <[email protected]>
2026-11-19 14:10:56 +00:00
WendelinandClaude Opus 5.5 c4dfc3910f Give settings switches an accessible name (#56014)
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Claude <[email protected]>
2026-11-19 14:50:42 +01:00
Maarten Lakerveld 5a528df3e3 Move header controls out of card headings (#56004) 2026-11-19 14:31:56 +01:00
Maarten Lakerveld cd87fc7ca1 Make card picker tiles keyboard and screen reader accessible (#56006) 2026-11-19 14:20:54 +01:00
Maarten Lakerveld 203bbb194f Label unlabelled icon buttons (#56007) 2026-11-19 14:18:39 +01:00
Maarten Lakerveld cdc875fc13 Put the mobile tab bar after the page content in focus order (#56002)
On narrow screens the subpage tabs sit at the bottom of the screen but
came before the content in the DOM, so keyboard and screen reader focus
jumped from the header to the bottom bar and back up. Render the bottom
bar after the content and FAB so focus follows the visual order.

Both tab bars are now a labelled nav landmark, so screen reader users
can still jump straight to the tabs without going through long lists.

fixes #14117
2026-11-19 12:49:38 +00:00
Bram KragtenandClaude Opus 5.5 3ba51a8ef2 Fix outdated demo themes (#56011)
The teachingbirds, kernehed and jimpower themes are dark themes, but
the demo applied them as light themes. Only the few variables they set
turned dark, so newer variables (text colors, inputs, dropdowns) stayed
light, giving black text on dark cards. Custom demo themes now declare
whether they are dark and are registered like a theme with only a dark
mode, so the app keeps them dark when it applies the theme again. They
also get a primary palette generated from their primary color, so
buttons, switches and checkboxes follow the theme. Variables that no
longer exist are removed, as is a black divider color that does not
show on a dark background.

Jimpower wrapped its picture elements cards in a bundled copy of the
archived card-modder, which could not load the lazy loaded card and
showed errors instead. Its styles are now ha-card theme variables, so
card-modder and card-tools are removed. The background these wrappers
set was always covered by the card images.

Arsaboo had an empty theme and now uses the default theme, like the
sections and home demos.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-19 12:17:21 +00:00
Bram KragtenandClaude Opus 5.5 52702f4a2b Make the demo dashboard editors work (#56010)
The home demo dashboard uses the custom:demo-home strategy, which did not
expose the editor of the home strategy it wraps, so its edit dialog only
offered YAML. The security page could not save because
frontend/set_system_data was not mocked.

Keep frontend system data per key for the session in the demo stub, and
notify subscribers on save. This also fixes the subscription returning the
core data for every key.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-19 12:14:37 +00:00
e31b404177 Rebrand Home Assistant Cloud to Home Assistant Link (#55231)
* Rename Home Assistant Cloud to Home Assistant Link

* Update the Nabu Casa logos to the new branding

* Use the Nabu Casa mark for Home Assistant Link icons

* Size the Nabu Casa logo by height in the voice assistant setup

* Rename the remaining Cloud integration error to Home Assistant Link

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Use the link icon for Home Assistant Link

* Update the Home Assistant Link description in settings

---------

Co-authored-by: Bram Kragten <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-19 12:54:50 +01:00
Paul Bottein 9338b91f18 Show the integration type in the entity type list (#55958) 2026-11-19 10:00:51 +00:00
Jan Bouwhuis b41693b8d2 Move dragged network graph nodes without layout animation (#55993)
* Move dragged network graph nodes without layout animation

* Keep the position of a node dragged without layout animation on a new layout run
2026-11-19 09:55:22 +00:00
Chanelle 407cf9e6a4 Give the onboarding welcome cards a button role (#55999) 2026-11-19 09:45:16 +00:00
Petar Petrov 02aacd0c51 Recover from a used or expired auth callback URL (#55989)
Drop a stale auth callback instead of retrying it on every reload
2026-11-19 07:03:20 +01:00
renovate[bot] f80d578deb Update dependency lint-staged to v17.6.1 (#55995)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-18 19:20:34 +00:00
Bram KragtenandClaude Opus 5.5 67297d7806 Add the link My redirect for Home Assistant Link (#55954)
Home Assistant Cloud becomes Home Assistant Link in 2026.12, so the My
link gets the new key link. cloud stays for existing links and badges,
and for my.home-assistant.io, which keeps sending instances to cloud for
now. link comes first so the "m" shortcut creates links with the new key.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-18 20:13:32 +01:00
renovate[bot] 46204a1955 Update dependency barcode-detector to v3.2.4 (#55992)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-18 17:38:27 +02:00
Jan-Philipp BeneckeandCopilot Autofix powered by AI 04ab43929e Show update release notes messages in the more info dialog (#55388)
* Show update release notes messages in the more info dialog

* Replace message display with ha-markdown component

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* Add RTL support for message display in ha-markdown component

* Add language parameter to updateReleaseNotes function

* Fix position

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
2026-11-18 06:47:54 +01:00
Erwin Douna 10b7f5ffb6 Move database analyze to the Storage page toolbar (#55982)
* Move database analyze to the Storage page toolbar

* Load the database report once recorder is available
2026-11-18 00:10:47 -05:00
Erwin Douna cce6a720f3 Show integration icons in the startup details (#55981)
* Show integration icons in the startup details

* Use ha-domain-icon in startup details
2026-11-17 14:10:45 +01:00
Maarten Lakerveld c8f6a9ef77 Revert "Let users hide entities from the maintenance page (#55610)" (#55979)
This reverts commit 49e5220634.
2026-11-17 12:27:02 +01:00
Raman GuptaandClaude Opus 5.5 94bd98d78d Call debounce immediately on the first call after cancel (#55963)
cancel() cleared the timer but kept its id, so with immediate=true the
next call saw a pending timer and was delayed by the wait instead of
firing on the leading edge.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-17 11:53:06 +01:00
Erwin Douna 0904c2a547 Show startup progress while Home Assistant starts (#55834)
* Show startup progress while Home Assistant starts

Replace the startup toast that named the longest running integration with a compact progress card: phase, integrations set up out of scheduled, and expandable details for active, failed and retrying integrations. Completion is only shown once Core is running.

* Address startup progress review feedback

Use a native toggle button with aria-expanded, mirror the centering in RTL, raise secondary text contrast, consume localize from context and keep listening after dismiss so the completion toast is accurate.

* Keep startup progress clear of toasts

Only offer the integrations action to admins, announce only phase and issues, lift the toast stack above the card and reattach the card after the launch screen swap.

* Move startup details into a dialog

* Handle older cores and late snapshots in startup progress

* Follow the new startup progress payload

* Make the startup toast minimal

* Add fallbacks to the startup toast
2026-11-17 11:39:36 +01:00
Raman GuptaandClaude Opus 5.5 2fd66939e7 Limit fraction digits in formatNumber to what Intl supports (#55968)
To keep trailing zeros, a numeric string's decimal places were used as
the fraction digits, and Intl.NumberFormat throws a RangeError for more
than 100. Cap them at 100.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-17 11:31:46 +01:00
Matthias AlphartandClaude Fable 5.2 5e340cb4e5 Fix automation editor crash when a condition row holds a service action (#55959)
Co-authored-by: Claude Fable 5.2 <[email protected]>
2026-11-17 11:29:28 +01:00
Raman GuptaandClaude Opus 5.5 8b2dc28d0f Fix groupBy for keys that exist on Object.prototype (#55964)
Grouping into a plain object made `key in result` true for keys such as
constructor or toString, so push was called on the inherited function
and threw, and a __proto__ key replaced the result's prototype. Group
into a Map and convert it with Object.fromEntries instead.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-17 09:28:36 +01:00
Paul Bottein 8d933e85d4 Add range selection and highlight to charts (#55472)
* Add range selection and highlight to charts

* Keep range selection on release outside the chart and simplify the highlight

* Add range selection examples to the statistics chart gallery page

* Unify chart selection with a fade mask and a clear button in the gallery

* Move chart selection and highlight into ha-chart-base

* Clear stale chart masks after a data update

* Make chart selection opt-in with select-mode and cache the mask color

* Keep drag to zoom when the chart select mode is point

* Only add empty chart mask areas once a mask was shown

* Set the mask flag where the mask is applied and skip hidden statistics when snapping
2026-11-17 08:50:22 +01:00
Raman GuptaandClaude Opus 5.5 b93869e668 Fix IP address validation for leading zeros and embedded IPv4 (#55972)
IPv4 octets accepted leading zeros such as 010.1.1.1, which the backend
rejects. The IPv6 pattern also missed addresses ending in dotted IPv4
after five or six groups, such as 1:2:3:4:5:6:1.2.3.4. Build the IPv6
pattern from the RFC 3986 grammar, which covers every IPv4 suffix form
and reuses the stricter IPv4 octet.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-17 09:13:01 +02:00
Raman GuptaandClaude Opus 5.5 bfd511deaf Quote CSV values that contain line breaks (#55965)
csvSafeString only quoted values containing a comma or quote, so a
logbook message or state with a line break split its row in the
exported CSV.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-17 09:08:56 +02:00
Raman GuptaandClaude Opus 5.5 eeec2d4662 Ignore unparsable date query params (#55971)
A history or logbook URL with a start_date or end_date that couldn't be
parsed decoded to an Invalid Date, and createHistoryLogbookUrl threw a
RangeError calling toISOString on it. Leave such dates out so the panel
uses its default range.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-17 09:08:17 +02:00
renovate[bot] 500249d996 Update pnpm to v12.21.0 (#55978)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-17 08:31:11 +02:00
Norbert Rittel a4157a490d Change "Power sources (graph)" to "Power profile (graph)" (#55951)
Change "power sources (graph)" to "power profile (graph)"
2026-11-17 08:18:59 +02:00
Raman GuptaandClaude Opus 5.5 d24ec6d34f Parse animation duration units regardless of case (#55970)
CSS units are case-insensitive, but only lowercase s and ms were
recognized, so 3S was read as 3 ms and 300Ms as 300 seconds.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-17 07:07:54 +01:00
Thomas van TilburgandCopilot Autofix powered by AI bef72ec5da Allow selecting a sensor for battery capacity (#55713)
* Allow selecting a sensor for battery capacity

* Update accessible label for battery capacity input

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
2026-11-17 08:07:40 +02:00
Raman GuptaandClaude Opus 5.5 87add82ad0 Uppercase first letters outside the BMP in capitalizeFirstLetter (#55967)
charAt(0) returns only the high surrogate of a letter outside the BMP,
which has no uppercase form, so the letter was left unchanged. Use the
first code point instead.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-17 07:06:27 +01:00
Raman GuptaandClaude Opus 5.5 eb70761886 Show the next unit in bytesToString when rounding reaches it (#55974)
The unit was picked before rounding, so a value just below a unit
boundary, such as 1048575 bytes, rounded to 1024 KB instead of 1 MB.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-17 07:05:05 +01:00
Raman GuptaandClaude Opus 5.5 74a2d3636b Transliterate Cyrillic х as kh in slugify (#55973)
х was also listed in the single-character map, which runs first and
replaced it with h, so its kh entry in complex_cyrillic was never used.
Remove it from the single-character map.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-17 07:03:22 +01:00
renovate[bot] f03740c446 Update Playwright (#55976)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-17 07:00:37 +01:00
renovate[bot] 4873df0df6 Update dependency eslint to v10.15.0 (#55977)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-17 07:00:21 +01:00
Erwin Douna d08b734afd Add database usage card to the storage page (#55659)
* Add database usage card to the storage page

* Address database usage card review feedback

* Open settings for disabled entities and use theme color variables

* Address review feedback on the database card

* Analyze the database on request

Follow the reworked recorder/database_usage response: separate entities and statistics, nullable tables, free and WAL bytes.

* Only make rows with entity settings clickable
2026-11-16 21:21:35 +01:00
renovate[bot] 4d1fc1225d Update dependency serve to v14.2.8 (#55956)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-16 20:33:48 +02:00
Dusan Cervenka 18bcddaa20 Use each light's Kelvin range in the service color temperature slider (#55947)
* Use each light's Kelvin range in the service color temperature slider

The light turn-on action advertised one 2000-6500 K slider for every
light, so a device with a different range could not be set from the
automation editor. The slider now follows the targeted lights.

* Limit the Kelvin slider to the lights an action actually calls.

The optional color temperature field now starts inside that range. The adjustment stays on light.color_temp_kelvin, and an area target no longer includes a light assigned to another area.

* Ignore secondary lights and normalize entity ids in the Kelvin range.

Service calls skip hidden and categorized lights reached only through an area or device, and legacy entity ids can be comma-separated or mixed-case.

* Use targeted entity ranges inside the color temperature selector.

The service form already supplies those entities, so the slider no longer resolves targets on its own.

* Leave the stored color temperature when the slider range changes.

The selector shows the targeted lights' Kelvin bounds, and core already clamps the value a light can produce.

* Start an optional Kelvin value inside the targeted lights' range.

Checking the field creates the stored value, so it matches the slider. Later light updates leave that value alone.

* Move the optional Kelvin default into a follow-up.

The selector change stands on its own.
2026-11-16 19:04:07 +01:00
Petar Petrov ca576fadf5 Remove unused cost_adjustment_day from grid sources (#55883) 2026-11-16 17:14:55 +02:00
Petar Petrov aea1ac4ac8 Fix history graph gaps after unavailable or inactive periods (#55908)
Keep history line after unavailable gap in downsampled charts
2026-11-16 16:12:49 +01:00
starkillerOG 6e1fe2846e Only fetch 4 thumbnails concurrently (#55952)
* Only fetch 4 thubmnails concurrently

* Restart thumbnail loading after a disconnect during a fetch
2026-11-16 15:26:03 +01:00
Paulus SchoutsenandClaude Opus 5.5 17202283b4 Count camera favorites as two slots in common controls (#55913)
* Count camera favorites as two slots in common controls

A camera favorite shows as a picture card that is two rows high, so it
fills the space of two tiles. The common controls limit counted it as
one entity. The extra suggestions then went into a new row.

The limit now counts tile-sized slots. A camera uses two of them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5HYRVdFHKnLsjPaoyy

* Count favorite slots in the home editor suggested toggle

The home editor disables the suggested entities toggle when the
favorites fill the section. It counted entities, so four camera
favorites left the toggle on although no suggestions show.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5HYRVdFHKnLsjPaoyy

* Fill free slots when pinned entities do not all fit

When the pinned entities use more slots than the limit, the ones that
fit can still leave a free slot. For example, two pinned cameras with
a limit of 3. The section now checks the size of the pinned entities
that fit, and fills the free slot with a suggestion.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5HYRVdFHKnLsjPaoyy

* Revert "Fill free slots when pinned entities do not all fit"

When the pinned entities that fit leave a free slot, the section asks
for suggestions. If usage prediction is not loaded, the section then
shows a message or hides itself in place of the pinned entities.

When the pinned entities fill the limit, the section now shows them
without suggestions again.

This reverts commit df676dfbe5.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5HYRVdFHKnLsjPaoyy

* Always show pinned entities in common controls

The limit could drop pinned entities that did not fit. If usage
prediction was not loaded, the section showed a message or hid itself
in place of the pinned entities.

Pinned entities now always show. Predictions only fill the slots that
the pinned entities leave free.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5HYRVdFHKnLsjPaoyy

---------

Co-authored-by: Claude <[email protected]>
2026-11-16 14:44:24 +01:00
Petar Petrov 0c8323c4f6 Allow theming timeline colors of custom states (#55930)
* Allow theming timeline colors of custom states

States of domains without state colors now use --state-<domain>-<state>-color (or its device class variant) when the theme defines it, before falling back to the graph palette.

* Drop device class variant for custom state colors

* Restore device class variant for custom state colors
2026-11-16 14:40:01 +01:00
Bram KragtenandClaude Opus 5.5 a2a523d5e5 Ignore outdated HLS starts and fetch a fresh stream URL on restart (#55953)
A start that was still fetching the stream URL, loading hls.js or
fetching the playlist could finish after the player was hidden or
removed, and create a player nobody stops. Count clean ups the same way
the WebRTC player does and drop starts that are outdated.

Restarting after a clean up reused the old stream URL. Core resets its
access token once the stream has been idle for 30 seconds, so the
restart got a 404 and the card fell back to MJPEG. Since the companion
apps now clean up right away when hidden, this happened every time the
app was in the background for more than 30 seconds. Fetch a new stream
URL on every restart instead.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-16 14:51:15 +02:00
Bram Kragten b379c0d311 Stop camera streams right away when hidden in the companion apps (#55887) 2026-11-16 14:29:33 +02:00
Julian 4dc975ec23 Keep the ha-ripple press while it is still active (#55942)
Hide a mouse or pen press when it moves off the control and show it
again when it returns while still held, since releasing it there still
clicks. Ignore the context menu during a touch press so a long press
keeps its pressed state until the touch ends.
2026-11-16 13:29:16 +01:00
Tristan Milnthorp 84294d7a8f Don't count light groups in the home summary when their lights are counted (#55903)
* Don't count light groups in the home summary when their lights are counted

* Share the group member helper with the more-info dialog

* Let the group member helper own the registry lookup too

computeGroupMemberIds now reads the registry's group_entities first, then
the state's group_entities, then the state's entity_id, so the more-info
dialog and the home summary share one definition.

For more-info, the only difference is that the state's group_entities is
now tried before entity_id when there is no registry copy. Core writes the
same capability into both, so it is the same data.

* Check nested group members for listed lights at any depth

* Keep one of two listed groups that contain each other
2026-11-16 13:08:05 +01:00
e5838446c8 Redesign the cover more-info dialog (#55614)
* Redesign the cover more-info dialog

* Refine cover drawings, handle and target edge

* Fix cover position fallback, tilt percentage and cancelled drags

* Remove speed selection from the cover dialog

* Hide the cover drawing from assistive tech without position

* Clean up the cover dialog code and rework the tilt control

* Soften the cover tilt gauge

* Use a generic drawing for doors and windows and simplify cover commands

* Update the active cover favorite when the position changes

* Drop the cover request when the position changes without moving

* Fix cover request controller typecheck

Co-authored-by: piitaya <[email protected]>

* Stop registering the cover request controller on its host

* Show the selected cover mode value in the header and hold tilt requests while moving

* Show only the state in the cover header when the value is unknown

* Follow the ARIA slider convention for cover arrow keys

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: piitaya <[email protected]>
2026-11-16 12:36:51 +01:00
Christopher Pruijsen 53f000e492 Fix more info opening when releasing outside an entity row control (#55890)
* Fix more info opening when releasing outside an entity row control

A press that starts on the control of an entity row and ends on the name
made the browser send the click to the row, which opened more info or ran
the hold action. The row now drops that click.

* Let clicks without a pointer through after an unfinished control press

A control press that ends without a click left the flag set, so the next click on the row with no pointer behind it (assistive technology or element.click()) was dropped. Only pointer clicks (detail > 0) are dropped now.
2026-11-16 13:15:57 +02:00
renovate[bot] c452e8e4ff Update formatjs (#55875)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-16 12:12:54 +01:00
Maarten Lakerveld e80b07893d Read formatjs locale data from the new IIFE wrapper (#55950)
The formatjs patch releases in #55875 wrap each locale-data file in an
IIFE that receives the data as its argument. The extractor matched the
__addLocaleData(...) call and captured the identifier `data`, so every
build failed while parsing locale data.

Take the IIFE's trailing argument when present and fall back to the old
inline call, so the script works before and after the bump.
2026-11-16 13:01:42 +02:00
Daniel SadilekandClaude Opus 5.5 c801a52e67 Show previous values below current ones in the energy Totals table (#55897)
* Widen the energy Totals table so comparing periods fits

With "Compare data" on, the Totals table (energy-sources-table) adds the
columns "Previous energy" and "Previous cost". On the Summary view it sat
in a one-column section, and on the Gas and Water views it had 12 of 36
grid columns, so the current Energy and Cost columns were pushed out of
view behind a horizontal scrollbar.

The Totals section on the Summary view now spans two columns and the card
fills it. On the Gas and Water views, the graph and the Totals table each
take the full width, one below the other, as on the Electricity view.

Fixes #54975

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Show previous values below current ones in the energy Totals table

Reverts the layout changes of the previous commit. With "Compare data" on,
the Totals table (energy-sources-table) added the columns "Previous
energy" and "Previous cost", which pushed the current Energy and Cost
columns out of view in narrow cards. The table now keeps its Source,
Energy and Cost columns and shows the previous period's value as a
secondary line in the same cell, so it fits at any card width, also on
custom dashboards.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Use ha-tooltip for the previous value's label

The secondary line used a native title attribute. It now uses ha-tooltip,
as the repository does for contextual hover help.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Make the previous values keyboard accessible and their IDs unique

The tooltip anchors of total rows were derived from their translated
labels, which could collide in non-Latin languages. Total rows now pass a
fixed key. The previous values are focusable, so keyboard users can open
their tooltip too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Label the previous values in the table header

The previous values were explained only by a per-cell tooltip, which touch
users could not open. The Energy and Cost headers now show "Previous
energy" / "Previous cost" as a secondary line while comparing, which
works for touch, keyboard and screen readers alike. The tooltips, their
IDs and the extra tab stops are gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-16 10:40:44 +00:00
WendelinandClaude Opus 5.5 8ac2712e31 Keep config navigation rows named on older Android WebViews (#55949)
* Keep config navigation rows named on older Android WebViews

Since list rows only wrap the headline and supporting text in their
button, the Companion app row became a text-only button. Android System
WebView 83 (API 30) then sometimes exposes it without a name, so the
row is missing from the accessibility tree and the Android E2E test
fails to find it.

Pass the text as headline and supporting-text properties instead of
slotting it, so it is rendered inside the button itself. The
accessibility tree in current browsers is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eF2M9PZKwPrPLV631p

* Remove comment from config navigation list

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eF2M9PZKwPrPLV631p

---------

Co-authored-by: Claude <[email protected]>
2026-11-16 11:39:00 +01:00
Tim Laing f7f15ae4a8 Expose color helpers to custom cards (#55935)
* Expose color helpers to custom cards

* Remove color helper documentation from README
2026-11-16 09:37:12 +00:00
HugoPeters1024 e66733186e circular slider: disable keyboard input when disabled (#55943) 2026-11-16 09:35:38 +00:00
karwosts 1e7bdbbcc8 Restore missing mobile tooltips (#55929) 2026-11-16 09:50:32 +01:00
renovate[bot] 7292db76bf Update dependency @codemirror/lint to v6.9.8 (#55940)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-16 09:38:26 +01:00
renovate[bot] 9d997fbe4c Update dependency jsdom to v31.0.1 (#55941)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-16 10:30:01 +02:00
Jan Bouwhuis 05d11c25c2 Keep dragged nodes in place in network graphs (#55808)
* Keep dragged nodes in place in network graphs

Fix the ECharts force drag order, so a node can be dragged with physics
on when layoutAnimation is off. Pin dragged nodes where they are dropped
and keep their positions through re-renders. Count only nodes of visible
legend categories for the layoutAnimation threshold.

* Keep pins through legend changes, clicks and chart recreation

Write the pin and position of a dropped node into the ECharts item option,
so a legend re-layout keeps them. Pin a pinned node again after a click,
and render again when the chart is recreated, e.g. after a theme change.

* Move only the dragged node with reduced motion

With reduced motion, a drag no longer runs the force layout, so only the
dragged node moves. A new force option of our ECharts patch, dragAnimation,
tells this apart from layoutAnimation, which is also off above 100 nodes.

* Drop the ECharts drag patch

Restore the ECharts patch and the lockfile to dev, and remove the
dragAnimation option. Dragging with physics on and without layout
animation is an ECharts issue to fix upstream.

* Render on legend changes only when the layout animation flips

The legend lays the graph out again itself, so the hidden categories are
no longer reactive. Only a change of the layout animation threshold saves
the positions and renders. Keep the private ECharts series access in one
helper.
2026-11-16 10:02:31 +02:00
Christopher Pruijsen ec14a9fe39 Fix horizontal scroll on the backup location page on narrow screens (#55934) 2026-11-16 08:52:27 +02:00
renovate[bot] fc640e236d Update dependency fullcalendar to v7.1.5 (#55933)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-16 06:15:28 +01:00
renovate[bot] c2db01285c Update github/codeql-action action to v4.39.3 (#55938)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-16 06:14:33 +01:00
Petar Petrov f2d0da08ed Edit batteries measured per direction (#55606)
* Edit batteries measured per direction

The battery editor first asks what the battery measures: only the total
in and out, or separately for grid, solar and home. Per direction shows
an energy and an optional power sensor for each flow, offers Integral
helpers for power-only flows, and warns when a flow's source is missing.

* Hide a battery's generated power sensor from its total power pickers

Switching a battery to another power setup removes its generated net
power sensor, so it can't be picked as the new power sensor.
2026-11-15 21:22:40 +01:00
Simon LamonandPetar Petrov 502dcdc1a6 Fix getWeatherExtrema when either is 0° (#55687)
* Fix getWeatherExtrema when either is 0°

* Update src/data/weather.ts

Co-authored-by: Petar Petrov <[email protected]>

* Simplify tempLow assignment conditions

Refactor temperature low assignment logic in weather.ts

* Prettier

* Apply suggestion from @MindFreeze

Co-authored-by: Petar Petrov <[email protected]>

---------

Co-authored-by: Petar Petrov <[email protected]>
2026-11-15 17:19:50 +02:00
renovate[bot] 0d31ae5624 Update dependency @rslib/core to v1.0.7 (#55925)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-15 14:24:47 +01:00
renovate[bot] f57384a265 Update dependency glob to v14.0.6 (#55926)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-15 14:24:40 +01:00
Tom Carpenter 4fe20d7712 Show Day of Week on Energy Period Selector card (#55924)
Show Day of Week on energy period selector card

When a single date is displayed, include day of week in the text.
2026-11-15 14:52:25 +02:00
Yosi LevyandCopilot Autofix powered by AI 14a4c05130 Marquee RTL support (#55876)
* Marquee RTL

* Refactor _animationFactor to a getter

Refactor _animationFactor to be a getter that determines its value based on document direction.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
2026-11-15 12:49:43 +00:00
Petar Petrov 2d6ebd26d9 Use measured battery flows on the energy dashboard (#55604)
* Move energy settings from dialogs to an editor sidebar

Sources and devices on all energy configuration tabs now open in a
sidebar like automation steps, with the selected row highlighted and a
save button for unsaved changes. Cost tracking and power measurement type
use dropdowns, and the editor inputs are grouped with dividers. The energy
setup wizard keeps its dialogs, which now reuse the same editors.

* Read the energy editors' data from contexts

The energy editors, the power measurement config and the upstream device
picker consume contexts instead of hass, so the setup wizard dialog no
longer passes it. createConfigFlow, handleConfigFlowStep and
getSensorDeviceClassConvertibleUnits take callApi or callWS.

The sidebar slots the editor in, so switching to the bottom sheet keeps
unsaved changes, and the lists are inert while the editor saves.

* Confirm unsaved energy edits on the back arrow

The toolbar back arrow asks before discarding the editor's changes, like
the automation editor does, and the sidebar is inert while the editor
saves, like the lists.

* Edit energy sources and devices on pages of their own

Sources and devices open on a page with a back arrow, their name as the
title and the form in a card, instead of in a sidebar. The lists go back
to the centered column, and the energy setup wizard keeps its dialogs.

* Keep energy page saves and deletes apart

Save and Delete are disabled while the other runs, since both write all
preferences, and a page that was left no longer navigates when its save
or delete finishes.

* Use measured battery flows on the energy dashboard

A battery can report its energy and power per direction: grid to
battery, solar to battery, battery to home and battery to grid. The
cards now use those flows as measured and estimate only the rest, so
grid charging no longer shows up as solar charging. Batteries with
total in and out statistics work as before.

The power Sankey now shares the energy flow math, and its type links
get explicit values instead of the greedy fill.

* Describe battery totals without a destination

* Show the energy error screen when statistics fail to load

Editor pages wait for the statistics metadata, so a failed request kept
them loading forever. It now shows the panel's error screen, like a
failed preferences or validation request.

* Name unnamed per-direction batteries in the power Sankey

* Don't register removed dirty state providers again

* Keep measured flows without a meter out of the home load

A measured battery flow whose grid or solar meter isn't configured never
passed through that meter, so it no longer changes the home load. The
power Sankey passes grid and solar as unmetered when they have no power
sensor.

* Open energy items through links

The editors open on pages now, so the list rows, the add buttons and the
CO2 signal row are links that can open in a new tab. ha-automation-row
gets an optional href that wraps the icon and header in a link and keeps
the icons slot outside of it. The setup wizard still opens dialogs.

* Note that a battery needs a charge and a discharge direction
2026-11-15 09:48:14 +01:00
Adam Pyle 5ba1190cdd Use theme colours on the Cast receiver launch screen (#55879)
The launch screen hardcoded a light background and dark text, so it
stayed white when the user or the cast device used dark mode. Use the
theme variables the receiver's ThemesMixin already applies to the
document, keeping the previous colours as fallbacks.
2026-11-15 08:34:09 +00:00
Petar Petrov 81cf8050e4 Drop the hass-shaped context from the security alerts editor (#55851)
Security entity helpers take states and registries as separate values.
2026-11-15 09:23:44 +01:00
Petar Petrov 1a10982a5e Fix the category filter scope round-trip and the navigation path registries consumer (#55848)
* Keep category filter list on a quick scope round-trip

Clear the category filter only when the scope differs from the subscribed one, and consume the registries context once in NavigationPathInfoController.

* Skip navigation path re-resolves when its inputs are unchanged

Each controller compares the values it resolved with, instead of sharing a module-level areas and devices cache.

* Clear the category filter list on disconnect

A reconnect with a new scope would otherwise show the old scope's categories until the new ones arrive.
2026-11-15 09:23:07 +01:00
Petar Petrov fb8ac756ce Pass callWS to getExtendedEntityRegistryEntry (#55849)
Take callWS instead of a hass-shaped object and use the helper again in callProtectedLockService.
2026-11-15 09:19:17 +01:00
renovate[bot] 2c072ab254 Update dependency prettier to v3.10.1 (#55923)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-15 08:13:11 +00:00
renovate[bot] 31ca8c298b Update pnpm to v12.20.0 (#55922)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-15 09:03:19 +01:00
Jan Bouwhuis 1a5d8884ad Align MQTT subscribe card width with other cards (#55914) 2026-11-15 08:34:13 +02:00
karwosts 9a95c9dea9 Fix targetless media selector (#55921) 2026-11-15 08:34:08 +02:00
renovate[bot] 5db5f9075d Update babel monorepo to v8.1.2 (#55917)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-15 08:25:22 +02:00
renovate[bot] 6ce043a8e4 Update dependency maplibre-gl to v6.18.0 (#55920)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-15 08:25:14 +02:00
renovate[bot] d81a9f29b2 Update dependency tar to v7.5.23 (#55919)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-15 08:25:05 +02:00
renovate[bot] c39734f350 Update dependency glob to v14.0.5 (#55918)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-15 08:24:52 +02:00
renovate[bot] e65584e724 Update dependency prettier to v3.10.0 (#55910)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-14 19:15:42 +01:00
renovate[bot] 6641a43e43 Update tsparticles to v4.5.4 (#55909)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-14 19:15:17 +01:00
renovate[bot] 2706bd89a1 Update dependency vite to v8.3.8 (#55906)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-14 08:55:55 +02:00
renovate[bot] bd434eeb0d Update dependency @rspack/core to v2.3.2 (#55899)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-13 17:11:21 +02:00
Bram Kragten 92bcd97390 Bumped version to 20261028.6 2026-11-13 15:46:23 +01:00
Petar Petrov f06678a30a Fix legends fitting as narrow in the card editor preview (#55886) 2026-11-13 15:45:45 +01:00
Paul Bottein 6dc3df4ba5 Fix favorites centering in the more info dialog (#55884) 2026-11-13 15:45:44 +01:00
Bram KragtenandClaude Opus 5.5 36b17a4c47 Fix Matter add device dialog stuck on the spinner (#55869)
The dialog waited for the companion app's commission finish message on
every step, but only the app's own flow sends it. Steps that commission
through core or another app now advance as soon as the device appears.
A failed finish message after the device appeared also advances now.

The new device watcher unsubscribed twice after a find, which dropped
another subscriber from the device registry collection. After a few
adds the registry stopped updating and the dialog never saw the device.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-13 15:45:42 +01:00
Maarten Lakerveld ed6e25f0ab Make "Don't show again" a checkbox on the browser warning (#55863)
As a second button it was easy to press by accident. The reminder now has a
checkbox, and "Continue anyway" applies it.
2026-11-13 15:45:41 +01:00
Maarten Lakerveld 9b0a034bab Let browsers below the legacy floor continue at their own risk (#55829)
* Let browsers below the legacy floor continue at their own risk

Browsers below the floor get a "Continue anyway" button on the launch
screen instead of a dead end, e.g. for a wall dashboard. The warning returns
monthly, and from the first reminder on offers "Don't show again".

* Space the launch screen without max() on Chrome below 79

The launch screen's top spacer and OHF logo margins use max() with var()
inside. Chrome below 79 drops those after the cascade, leaving no margin,
so the logo touched the bottom edge (Chrome 67 to 78 are in the legacy
floor). Plain margins now come first, the max() rules behind @supports.

* Keep the browser warning up while the app loads

Once the user continued, the launch screen went blank until the legacy
build took over, which can take a while on these devices. Keep the message
and only drop the buttons.

* Say the browser is no longer supported instead of too old

With the option to continue it does run, so "too old to run Home Assistant"
contradicted the button. The same text now reads right before and after
continuing.

* Use a plain color for the launch screen buttons

Theme variables are not set yet while the launch screen shows, so
var(--primary-color) always fell back anyway.
2026-11-13 15:44:02 +01:00
Christian Wiedel 3c61ed2a9d Keep the demo launch screen from pushing the app down while it fades out (#55707) 2026-11-13 15:44:02 +01:00
Bram KragtenandClaude Opus 5.5 d5c17054a2 Add missing HASSDomEvent import to hui-root
The backport of #55640 uses HASSDomEvent in hui-root, but on dev the
import came from #55565, which is not on rc.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 15:39:24 +01:00
Petar Petrov 3ddd98b585 Name energy devices after their entity when a device has several meters (#55778)
* Name energy devices after their entity when a device has several meters

* Keep the device name as placeholder until an energy statistic is picked

* Compute the picker ambiguity set from the memoized arguments

* Count user-set energy device names towards a label collision
2026-11-13 15:37:14 +01:00
Christian Wiedel 3a388453ea Fix grouped data tables stuttering when scrolling in Safari (#55702)
* Fix grouped data tables stuttering when scrolling in Safari

Group header actions are rendered by a callback instead of a slot per group
header. The virtualizer adds and removes header rows while scrolling, and
WebKit is slow to add and remove slots.

Fixes #55636

* Keep group header actions when the data or the pinned group changes

Group header rows are keyed by their group, so an open category menu stays open when the data refreshes. The sticky header is keyed by the pinned group, so its actions don't act on the next group's category.

* Keep group header keys apart from row keys

A group named like a row's id gave the header and the row the same virtualizer key. Prefix the keys so they can't collide.

* Don't call the group header actions slotted in the styles
2026-11-13 14:45:59 +01:00
Petar Petrov 16f01e1081 Fix legends fitting as narrow in the card editor preview (#55886) 2026-11-13 14:28:15 +01:00
Dan SpencerandClaude Opus 5.5 050251db23 Offer a blueprint's trigger IDs in Triggered by conditions (#55802)
* Offer a blueprint's trigger IDs in Triggered by conditions

In an automation that uses a blueprint, a Triggered by condition in one
of its inputs listed no triggers, and flagged the IDs it already used as
missing. The editor took the list from the automation's own triggers,
and a blueprint automation has only `use_blueprint`.

For a blueprint automation, fetch the blueprint with its inputs filled
in (`blueprint/substitute`) and list the IDs its triggers set, fetching
again when the inputs change. A trigger without an ID isn't offered,
since the editor can't give one to a blueprint's trigger, and an ID
shared by several triggers is listed once, as the condition matches any
of them.

The condition is in one of the blueprint's inputs, which the trigger
controller doesn't edit, so its `select` returns false there, as
`updateTriggerId` does for a trigger it doesn't own, and the condition
editor saves the pick through `value-changed` instead.

An option shows its trigger number only while trigger rows show theirs
(`showIndices`): the numbers point at trigger rows, and a blueprint
automation has none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Ignore an empty use_blueprint while editing YAML

`use_blueprint:` with no value parses to null, and requesting its
triggers threw on `.path`, aborting the editor's update.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Hold back trigger warnings until a blueprint's triggers are known

While a blueprint's triggers load, or when its inputs can't be substituted
yet, a Triggered by condition can't tell a missing ID from one it hasn't
seen. The trigger context now carries optionsStatus: "loaded", "loading" or
"failed". Until it's loaded, the condition and the row's summary list the
selected IDs without the missing-trigger warning or chips. An empty
condition shows "Loading", or a hint to set the blueprint's required inputs
once substitution has failed. After a failure the last triggers stay listed.

use_blueprint is also compared by value, since YAML mode parses a new object
on every edit and an edit elsewhere fetched the triggers again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Address review: spinner, refetch warnings and index badges

- Show a delayed ha-spinner while a blueprint's triggers load, following
  the frontend's loading pattern, instead of visible "Loading" text.
- Mark every request as loading, keeping the last triggers listed, so an
  input change that renames a trigger's ID doesn't read as missing until
  the new triggers arrive.
- Publish showIndices false for a blueprint automation. Switching to YAML
  removes the manual editor's sidebar without reporting it, which left
  the blueprint's condition numbering trigger rows that don't exist.
- Drop inline comments from the blueprint trigger code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Show trigger IDs when trigger rows aren't numbered

A Triggered by condition tells options apart by description, custom ID or
index. In a blueprint automation there are no indices, so two triggers
that describe the same with generated-prefixed IDs looked identical while
selecting different IDs. Without indices, every option's ID is shown.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Say when a blueprint's triggers have no IDs

A blueprint whose triggers have no IDs loads with nothing to offer, and
the condition said "Add a trigger first", which can't be done in a
blueprint automation. optionsStatus is now blueprintStatus, left out for
an automation with its own triggers, so the condition can tell the two
apart and say the blueprint's triggers have no IDs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Rename blueprint_triggers_pending to blueprint_triggers_unavailable

It's only shown once substitution has failed, not while loading.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Drop controller tests that cover one-line branches

Keeps the tests for the response race, the statuses and refetching.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-13 06:26:48 +00:00
renovate[bot] 13128609de Update dependency @versatiles/style to v9.1.0 (#55893)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-13 08:22:31 +02:00
renovate[bot] 0f70813ada Update dependency marked to v18.2.0 (#55894)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-13 08:22:27 +02:00
Matthias 5762da9d22 Refresh the ingress session when the app panel becomes visible (#54863)
The ingress session is kept alive by a 60 s timer only. Timers do not run
while the device sleeps, so after the browser comes back to the foreground
the session may already be expired, and the Supervisor refuses every
request to the app until the next tick. An app that reconnects its
websocket right away stays unreachable for up to a minute.

Refresh the session on visibilitychange and resume as well. The refresh is
shared with the timer: validate the session, create a new one when that
fails, and never run twice at once. A failed refresh no longer surfaces as
an unhandled rejection, the next one retries.
2026-11-13 06:07:00 +00:00
renovate[bot] 33f709cd21 Update Node.js to v24.22.3 (#55892)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-13 06:54:27 +01:00
renovate[bot] 1f77e4cd59 Update dependency typescript-eslint to v8.72.2 (#55891)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-13 06:54:10 +01:00
Paul Bottein 77170b447f Fix favorites centering in the more info dialog (#55884) 2026-11-12 17:26:25 +02:00
c0ffeeca7 e2bb744202 MCP: change AI agent to AI app (#55885) 2026-11-12 17:25:49 +02:00
Wendelin 0eec83448a Revert camera ICE server filter and WebRTC-first memory (#55881)
* Revert camera ICE server filter and WebRTC-first memory

Follow-up to #55861 after review feedback:

- Use the full ICE server list from core again. The slow starts come from
  go2rtc, which stalls while it sets up TURN relays with the cloud ICE
  servers, so filtering in the browser does not help.
- Start HLS and WebRTC together again, remove the per-camera WebRTC-first
  memory and its 12 second HLS delay.
- Retry a WebRTC stream at most once, only after it played or on a backend
  error. A new connection that gets no answer or finds no path fails
  directly, so HLS or MJPEG takes over.

* Ignore stream URL errors of a removed HLS player

Switching cameras while the old HLS player was still fetching its stream
URL could mark HLS as failed for the new camera.
2026-11-12 14:51:53 +01:00
WendelinandClaude Sonnet 5.5 1864f6f802 Move the media browser list item to its own file (#55877)
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
2026-11-12 13:26:28 +01:00
renovate[bot] 9a19cc3bf6 Update dependency vite to v8.3.7 (#55880)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-12 13:24:58 +01:00
WendelinandClaude Fable 5.2 ec51fb4f8d Add attributes to wrap text in list rows (#55864)
The headline and supporting text of ha-row-item are truncated to one
line. Many pages overrode that with white-space rules on the headline
and supporting-text parts.

Add the wrap-headline and wrap-supporting-text attributes and use them
in place of those CSS overrides.

Co-authored-by: Claude Fable 5.2 <[email protected]>
2026-11-12 13:20:40 +02:00
Paul Bottein 6a1a9bfb1b Suggest area icons based on the area name (#55708)
* Suggest area icons from the room in the area name

* Fix stale icon list, closed dialog and AI icon override

* Keep an untouched area dialog clean after the icon prefill

* Keep the suggested section visible when a suggested icon is selected

* Move area icon keywords to the translations

* Move room keywords to a shared translation key

* Remove home cinema and gym from the room list

* Note the Lokalise draft effect of editing room keywords

* Ship room keyword drafts and group keywords under rooms.keywords

* Add more room types for area icon suggestions

* Fetch room keyword drafts through the Lokalise keys API
2026-11-12 10:51:12 +01:00
Maarten Lakerveld 16807d2765 Make "Don't show again" a checkbox on the browser warning (#55863)
As a second button it was easy to press by accident. The reminder now has a
checkbox, and "Continue anyway" applies it.
2026-11-12 09:48:17 +01:00
renovate[bot] 9caad65c91 Update dependency eslint-plugin-import-x to v4.18.1 (#55874)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-12 08:16:21 +02:00
Bram KragtenandClaude Opus 5.5 af523f1087 Fix Matter add device dialog stuck on the spinner (#55869)
The dialog waited for the companion app's commission finish message on
every step, but only the app's own flow sends it. Steps that commission
through core or another app now advance as soon as the device appears.
A failed finish message after the device appeared also advances now.

The new device watcher unsubscribed twice after a find, which dropped
another subscriber from the device registry collection. After a few
adds the registry stopped updating and the dialog never saw the device.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-12 08:12:21 +02:00
renovate[bot] 349d5f7125 Update dependency intl-messageformat to v12.1.5 (#55872)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-12 07:01:41 +01:00
renovate[bot] de64bd3c59 Update formatjs (#55873)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-12 07:01:21 +01:00
Zedas 5253eef284 Allow a few pixels of finger movement in the action handler (#55826)
* Allow a few pixels of finger movement in the action handler

* Cancel the action handler press when the browser takes over the touch

The document scroll listener only hears the page itself, not nested
scrollers. pointercancel is composed and fires when the browser starts
scrolling a touch, so it covers those as well.
2026-11-11 22:51:14 +01:00
WendelinandClaude Fable 5.2 b1164739c3 Make camera WebRTC streams connect faster and more reliably (#55861)
* Make camera WebRTC streams connect faster and more reliably

- Limit the ICE server URLs the browser uses to one STUN, one UDP TURN
  and one TCP TURN URL per host. The last retry uses the full list.
- Start WebRTC first for cameras where it worked before in this browser,
  with HLS as fallback after 12 seconds.
- Always prefer WebRTC over HLS once it plays.
- Restart a WebRTC stream up to two times when it fails, loses its
  connection or does not connect in time, then report the failure so HLS
  takes over.
- Fix the ICE candidates added to the offer.

Co-Authored-By: Claude Fable 5.2 <[email protected]>

* Address review and connect the microphone over the known path

- Always forget a camera when WebRTC shows no video within the deadline.
- Fall back to MJPEG when a WebRTC only camera delivers audio but no
  video.
- Keep using all ICE servers once a stream only loaded with them.
- Start the microphone connection with only the ICE servers the running
  stream needs for its path.

Co-Authored-By: Claude Fable 5.2 <[email protected]>

* Keep all ICE servers for a direct microphone path that needed them

Co-Authored-By: Claude Fable 5.2 <[email protected]>

* Improve microphone connection handling in WebRTC player

---------

Co-authored-by: Claude Fable 5.2 <[email protected]>
2026-11-11 16:35:47 +01:00
Petar Petrov 80a516c673 Allow selecting values in the energy sources table (#55852) 2026-11-11 16:07:46 +01:00
Petar Petrov d5d0f45919 Move energy settings from dialogs to pages (#55410)
* Move energy settings from dialogs to an editor sidebar

Sources and devices on all energy configuration tabs now open in a
sidebar like automation steps, with the selected row highlighted and a
save button for unsaved changes. Cost tracking and power measurement type
use dropdowns, and the editor inputs are grouped with dividers. The energy
setup wizard keeps its dialogs, which now reuse the same editors.

* Read the energy editors' data from contexts

The energy editors, the power measurement config and the upstream device
picker consume contexts instead of hass, so the setup wizard dialog no
longer passes it. createConfigFlow, handleConfigFlowStep and
getSensorDeviceClassConvertibleUnits take callApi or callWS.

The sidebar slots the editor in, so switching to the bottom sheet keeps
unsaved changes, and the lists are inert while the editor saves.

* Confirm unsaved energy edits on the back arrow

The toolbar back arrow asks before discarding the editor's changes, like
the automation editor does, and the sidebar is inert while the editor
saves, like the lists.

* Edit energy sources and devices on pages of their own

Sources and devices open on a page with a back arrow, their name as the
title and the form in a card, instead of in a sidebar. The lists go back
to the centered column, and the energy setup wizard keeps its dialogs.

* Keep energy page saves and deletes apart

Save and Delete are disabled while the other runs, since both write all
preferences, and a page that was left no longer navigates when its save
or delete finishes.
2026-11-11 15:53:24 +01:00
Petar Petrov f922bc59a5 Drop hass from the state card content (#55853)
stateCardType, canToggleState and canToggleDomain take states and services; HassMediaPlayerEntity takes callService.
2026-11-11 15:36:31 +01:00
Petar Petrov a71a79b01b Drop hass from the target details dialog (#55850)
The dialog reads localize, callWS, states and entities from contexts, and resolveItemExclusions takes callWS.
2026-11-11 15:21:23 +01:00
Petar Petrov 9b8409d7ec Show model ID in the devices table when the model is missing (#55856) 2026-11-11 15:17:41 +01:00
Petar Petrov fc8d21b920 Point links in a duplicated dashboard at the copy (#55859) 2026-11-11 15:15:13 +01:00
Maarten Lakerveld fce0f4da4e Migrate the image cropper dialog to cropperjs 2 (#55570)
* Migrate the image cropper dialog to cropperjs 2

Cropper.js 2 is a rewrite built on shadow-DOM custom elements: the v1
class API (getData, getImageData, getCroppedCanvas, the ready and crop
callbacks) and the cropper.css stylesheet no longer exist, so the plain
Renovate bump (#55562) fails type checking and every rspack build.

Render the v2 elements directly from the dialog template instead of
wrapping an <img>. The canvas has no intrinsic size, so decode the file
first and give the canvas the image aspect ratio; the image then fills
it exactly. Initialise after the dialog has finished its scale-in
animation, because the elements measure themselves with
getBoundingClientRect, and refit the image and selection when the
canvas is resized.

Keep the v1 behaviour the callers rely on: the selection cannot leave
the image or the visible canvas, the image cannot be moved or zoomed out
from under it (viewMode 1), resizing stops at 50px, the rounded preview
is CSS only so the exported file stays rectangular, and the export is
rendered at the source resolution. Dirty tracking compares the crop
rectangle in source image pixels, like getData() did in v1.

* Clamp cropper drags to the edge and show image load errors

Cropper.js 2 moves the selection and image in relative steps per pointer
event. Rejecting a step that crossed the image edge dropped its movement on
both axes, so on fast drags the selection fell behind the cursor and got
stuck along an edge, mostly with portrait images. Clamp moves, resizes and
image pans to the edge instead, as v1 did. Fixed-ratio resizes shrink
around the anchored side to keep the ratio.

Show an error alert when the picture cannot be decoded instead of an empty
dialog.

* Keep the Shift-locked aspect ratio when a free crop hits the edge

With a free aspect ratio, Shift locks the ratio during a resize. The
out-of-bounds correction clipped the proposal instead of scaling it, so
the selection lost that ratio at the image or canvas edge.
2026-11-11 14:44:01 +01:00
WendelinandClaude Opus 5.5 2391c700c6 Expose action buttons in list rows to screen readers (#55831)
* Keep action controls in list rows reachable for screen readers

ha-list-item-button wrapped the whole row, including the start and end
slots, in its native button or link. Controls placed in those slots
were nested inside it and hidden from assistive technology.

Only the headline and supporting text are inside the native element now,
and its hit area is stretched over the row. Slotted controls sit above
it; icons, badges, text and empty dividers sit below, so they still
activate the row with native link behaviour.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Rebind the list row ripple when the control is replaced

Switching href swaps the inner <a> and <button>, and media browser rows
drop the control when not interactive. The ripple kept listening to the
removed element, so the new control had no hover or press feedback.

Render the ripple after the control and recreate it with the control.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-11 15:26:10 +02:00
R HOCH RandCopilot Autofix powered by AI 8cd79a6776 Add button to duplicate dashboards (#55832)
* Add option to duplicate dashboards

* Add error handling for missing dashboard config

Handle config not found error when fetching dashboard.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
2026-11-11 13:25:56 +02:00
Petar Petrov b4f6e4e2ea Drop hass from the target picker (#55855)
* Drop hass from the target picker

getEntities takes an options object of separate values; ha-target-picker, ha-sources-picker, ha-selector-target and the exclusions controller consume contexts.

* Rerender the target picker only when a pending entity appears

Consume statesContext without @state and narrow a second consumer to the pending helper entity.

* Redraw target picker icons when the brands token arrives

Also refetch target selector entity sources after a reconnect, like the entity selector.
2026-11-11 11:00:13 +01:00
Lorenzo Marroccoli 50bb1cf53e Prefer model ID over firmware in integration device rows (#55845)
* Prefer model ID over firmware in integration device rows

* Include model ID in integration device search
2026-11-11 11:59:54 +02:00
Petar Petrov 70a1946874 Fix lazy context provider error and reconnect handling (#55854)
* Fix lazy context provider error and detached consumer handling

Retry failed subscriptions, drop consumers that left before the first value, and give config entry updates a new array.

* Reset config entries on a new snapshot

Replace the list when a resubscribe sends all entries again, and log failed subscriptions.

* Clear config entries on an empty snapshot

Core sends an empty list when no entries match the subscription.
2026-11-11 10:42:49 +01:00
Paul Bottein 3da9ba8119 Add default option and icons to the entity type select (#55833)
* Add default option and icons to the entity type select

* Simplify the entity type select code

* Store the device class override separately from the effective class
2026-11-11 09:57:22 +01:00
Petar Petrov eb8ac4139b Translate YAML editor error reasons (#55836)
Translate common YAML parse error reasons in the editor
2026-11-11 09:46:18 +01:00
Petar Petrov f9aae72325 Use "remove" wording when removing devices (#55835)
* Use "remove" wording when removing devices

* Keep "delete" wording for config entries
2026-11-11 09:18:30 +01:00
Christian Wiedel 81279aa6d2 Allow checking off to-do items without a name (#55847)
* Allow checking off to-do items without a name

* Keep whitespace-only names rejected by core
2026-11-11 10:08:27 +02:00
Eric RouleauandCopilot 33b8afffca Show area in ZHA device bindings and neighbors (#55812)
* Show area in ZHA device bindings and neighbors

The 2026.11 naming change means device names no longer carry
their area, but the Manage Zigbee Device panel still showed only
the device name in two places, making identically named devices
indistinguishable:

- The Bindable devices dropdown in the Bindings tab now shows
  the area as the option's secondary line.
- The Neighbors tab gains a sortable, filterable Area column.

Area resolution is shared in getZHADeviceAreaName(): it resolves
via the device registry (so child devices inherit their parent's
area, matching the ZHA network visualization) and falls back to
the area reported by ZHA itself.

* Address Copilot review: registry-authoritative area, memoize by registries

- Treat an existing device registry entry as authoritative: if it
  has no effective area, the device has no area, even if ZHA still
  reports one from its cached response. The ZHA area_id fallback
  now applies only when the device has no registry entry at all,
  so clearing a device's area no longer leaves stale area text.
- Narrow getZHADeviceAreaName() to take the area and device
  registries instead of the whole hass object, and key the
  Neighbors memo on those registries. Entity-state updates replace
  hass, which rebuilt every neighbor row and reran table
  sorting/filtering on unrelated updates.

* Use device picker for ZHA bindings

Co-authored-by: Copilot <[email protected]>

* Reuse getZHADeviceAreaName helper in other places that also did a similar registry lookup

---------

Co-authored-by: Copilot <[email protected]>
2026-11-11 08:46:05 +02:00
renovate[bot] b157dd174e Update dependency maplibre-gl to v6.17.0 (#55844)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-11 08:25:17 +02:00
renovate[bot] 4a0381e82d Update dependency @vvo/tzdb to v6.204.0 (#55843)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-11 08:17:15 +02:00
renovate[bot] 92e248c913 Update dependency @versatiles/style to v9 (#55846)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-11 08:15:54 +02:00
Maarten Lakerveld 5b1ecdb0b0 Let browsers below the legacy floor continue at their own risk (#55829)
* Let browsers below the legacy floor continue at their own risk

Browsers below the floor get a "Continue anyway" button on the launch
screen instead of a dead end, e.g. for a wall dashboard. The warning returns
monthly, and from the first reminder on offers "Don't show again".

* Space the launch screen without max() on Chrome below 79

The launch screen's top spacer and OHF logo margins use max() with var()
inside. Chrome below 79 drops those after the cascade, leaving no margin,
so the logo touched the bottom edge (Chrome 67 to 78 are in the legacy
floor). Plain margins now come first, the max() rules behind @supports.

* Keep the browser warning up while the app loads

Once the user continued, the launch screen went blank until the legacy
build took over, which can take a while on these devices. Keep the message
and only drop the buttons.

* Say the browser is no longer supported instead of too old

With the option to continue it does run, so "too old to run Home Assistant"
contradicted the button. The same text now reads right before and after
continuing.

* Use a plain color for the launch screen buttons

Theme variables are not set yet while the launch screen shows, so
var(--primary-color) always fell back anyway.
2026-11-10 16:53:24 +01:00
Zedas ee35dd8cf6 Send the final media player volume only once (#55828) 2026-11-10 15:04:46 +01:00
Daan VervackeandAidan Timson 42ce434a94 Add selection mode with bulk remove to the Marketplace repositories page (#55435)
* Add selection mode with bulk remove to the Marketplace repositories page

* Guard bulk remove against double clicks and drop stale selections

* Clear the table selection when a selected repository gets installed

* Restore the comments that still apply

* Use a Marketplace string for the bulk action menu

* Drop rendering-only tests

* Uncheck data table rows that can no longer be selected

* Use one Remove chip and let the table drop installed rows

---------

Co-authored-by: Aidan Timson <[email protected]>
2026-11-10 14:40:47 +01:00
Zedas 06d564dbd8 End the ZHA permit subscription when the search ends (#55822)
* End the ZHA permit subscription when the search ends

* End the ZHA search when the connection drops

* Don't send a stale ZHA search after a reconnect
2026-11-10 14:19:10 +01:00
Petar Petrov 93f0c2c45a Hold the last value across gaps in history graphs (#55817)
* Hold the last value across gaps in history graphs

* Hold values across gaps in every graph, without an opt-in

* Hold the real last state across gaps and keep their curves tight

* Only hold stretches the raw history was quiet for

* Keep the temperature forecast curving across gaps

* Decide which stretches to hold once, from the raw history

* Hold neither across unavailable states nor below the sampling frame
2026-11-10 13:53:49 +01:00
renovate[bot] fb40d07621 Update dependency @html-eslint/eslint-plugin to v0.68.0 (#55825)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-10 11:53:04 +00:00
Zedas a6073e44f7 Translate the fold markers in the code editor (#55821) 2026-11-10 11:44:59 +00:00
Paulus SchoutsenandClaude Opus 5.5 df69f3c7ee Show which integrations use an integration loaded as a dependency (#55499)
* Show which integrations use an integration loaded as a dependency

Some integrations, like Modbus, have no config flow and are loaded
because another integration lists them in its manifest dependencies.
The frontend treated these as YAML integrations. The integration page
told the user to configure it in configuration.yaml, and the dashboard
showed a YAML card for it.

The integration page now fetches the loaded manifests for integrations
without a config flow. If a loaded integration depends on the domain,
the page shows "Used by <integrations>" instead of the YAML text. The
dashboard does not show a YAML card for a domain that a loaded
integration depends on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

* Show the integrations that use a dependency as linked cards

Replace the "Used by" text with a "Used by" section. It lists each
loaded integration that depends on this integration, with its logo and
a link to its integration page. The entries section shows "No entries"
instead of the YAML text for such an integration.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

* Show only the "Used by" section for a dependency

An integration that other loaded integrations depend on, and that has no
config entries, now shows only the "Used by" section. The page does not
show the empty entries section. It also does not show the "Add entry"
button, which only opens the "set up in YAML" dialog for these
integrations.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

* Match the demo Modbus and LoRaWAN manifests to core

Modbus and LoRaWAN have no config flow, and the integrations that use
them list them as dependencies. The demo now does the same, so their
integration pages show the "Used by" section.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

* Hide system integrations from the "Used by" section

System integrations, like Default Configuration, depend on many
integrations. Listing them in "Used by" does not help the user.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

* Read the dependents from the manifests context

The integration page now finds the integrations that depend on it from
the shared manifests context, instead of its own manifest/list call.
It subscribes to the context only for an integration without a config
flow, so other integration pages do not make the context fetch the
manifests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

* Link the integration page to the integration's settings panel

The Connectivity settings panels, like Zigbee and Modbus, are not
reachable from the integration page unless the integration has a config
entry. A user that opens the integration page looks for these settings.

The integration page now shows a button that opens the panel of the
integration. The button uses the panel name from the Connectivity page.
LoRaWAN, Modbus, Radio frequency, and USB (Serial) are added to the map
of integrations with a panel.

An integration with a panel and no config flow does not show the
"Add entry" button. For these integrations, it only opens the "set up
in YAML" dialog, and the panel is where to set them up.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

* Hide the YAML texts for integrations set up in their panel

An integration with a settings panel and no config flow, like Infrared,
is set up in that panel. Its integration page told the user to set it up
in configuration.yaml. The page now shows only the settings button for
such an integration when it has no entries.

The demo Infrared and Radio frequency manifests now match core, so these
pages show it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

* Make the settings button primary when it is the only action

An integration that is set up in its panel shows no "Add entry" or
"Add device" button, so the settings button is its only action.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

* Show the settings button only when there are no entries

Each config entry row of an integration with a panel already has a
link to that panel, so the button repeats it on pages like Zigbee.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

* Link the MCP integration pages to the AI settings

The AI settings show how to connect to the MCP server and the URL of
each of its APIs. The MCP client and MCP server integration pages now
have an "AI settings" button that opens them. The button is the
primary action when the page has no "Add entry" button.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

* Scroll the AI settings to the MCP card from the MCP pages

The AI settings page now scrolls to the section named in the URL hash,
like the backup settings page. The "AI settings" button on the MCP
integration pages links to the MCP card, which is below the AI task
card.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

* Keep the demo route when opening the AI settings

The demo routes with the URL hash. The AI settings page cleared the
hash even when it did not name a section, so a reload of the demo lost
the page. It now clears the hash only after it scrolls to a section.

The "AI settings" button links to the page without a section in the
demo, because a link with a hash skips the demo route conversion.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

* Move the settings panel and MCP buttons to their own PRs

This PR keeps the "Used by" section for integrations that other
integrations depend on. The settings panel button and the MCP link to
the AI settings move to separate PRs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

* Load the Modbus dependents in the demo

The dashboard reads the dependencies of loaded integrations only. The
demo listed Modbus as loaded, but not Flexit, SolarEdge Modbus, and
Fronius, so it showed a YAML card for Modbus.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

* Sort the "Used by" list and wait for it before the YAML texts

The manifests come from a set in core, so their order can change
between restarts. The "Used by" list is now sorted by name.

Until the manifests load, the page does not know the dependents. It
showed the YAML texts and "Add entry" first and then replaced them with
"Used by". The page now holds back those texts and the button for an
integration without a config flow until the manifests load.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

* Apply review feedback

- Make the settings button primary whenever it is the only action,
  like the MCP button. Thread, or MQTT with its one entry, have no
  "Add entry" button.
- Set the demo LoRaWAN manifest to the service type, like core, so the
  demo dashboard checks its dependents.
- Fix the punctuation of the YAML text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

* Show the entries while the dependents load

The page waits for the manifests of the loaded integrations before it
shows the YAML texts. If that request fails, the wait never ends. Only
a page without entries can show "Used by", so only such a page waits.
A page with entries now shows them even when the manifests do not load.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

* Clear the manifest when the integration page changes domain

The integration page is reused when you follow a "Used by" link. It
kept the previous integration's manifest until the new one loaded, so
going back to Modbus from Flexit briefly showed "Add entry" and the
empty entries section. The page now clears the manifest on a domain
change, and a page without entries waits for the manifest before it
shows the YAML texts and "Add entry".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

---------

Co-authored-by: Claude <[email protected]>
2026-11-10 10:55:56 +01:00
Markus TuominenandClaude Fable 5.1 95a009641f Fix integration icons being clipped into circles on the area page (#55820)
Stop rounding and distorting integration icons on the area page

The generic img rule meant for the area picture also applied to the 24px
brand icons in the device list, clipping square integration logos (for
example Awair) into circles. Scope that rule to the area picture and size
the icons with width/height attributes like the device page does.

Co-authored-by: Claude Fable 5.1 <[email protected]>
2026-11-10 10:17:22 +01:00
Wendelin 36f59f8495 Pass callWS to entity and device registry update helpers (#55819) 2026-11-10 11:02:12 +02:00
Stefan AgnerandClaude Opus 5.5 8a13bba521 Only match an OTBR to a Thread network it is part of (#55803)
* Only match an OTBR to a Thread network it is part of

findOTBRInfoForDataset returned the dataset's preferred border router
without checking that it is still on that network. When the border
router had moved to another network, the Thread panel offered to reset
it from the card of a network it no longer belongs to, which would
replace the border router's current network.

Require the extended PAN ID to match for the preferred border router
too, and drop the active dataset check in the network information page
that worked around the same problem.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Update findOTBRInfoForDataset tests for the network check

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep findOTBRInfoForDataset fallback tests independent of key order

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-10 11:00:30 +02:00
Maarten Lakerveld cc7b1952c0 End slider and color wheel interaction when a drag is cancelled (#55804)
End slider and color wheel interaction when a pan is cancelled

ha-control-slider and ha-hs-color-picker restored their value on
pancancel without firing an event, so consumers never learned that the
interaction ended. The light color pickers then kept ignoring state
updates until the next interaction. Fire the same end-of-interaction
event as panend (and as ha-control-scrubber already does), and restore
the wheel's local value along with its cursor position.
2026-11-10 10:59:38 +02:00
karwosts 2edf6f91d0 Allow configurable time format for timer.finishes_at in state-display (#55813)
Allow custom time format for timer.finishes_at
2026-11-10 09:26:27 +01:00
jimjaeger 9d52517ae9 Retry translation fragments after a failed request (#55716)
* Retry translation fragments after a failed request

* Clear translation mock before each test
2026-11-10 08:51:58 +02:00
renovate[bot] 27a7f6335f Update dependency @vvo/tzdb to v6.203.0 (#55814)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-10 08:25:58 +02:00
renovate[bot] cd44bfcebc Update dependency eslint-plugin-import-x to v4.18.0 (#55815)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-10 08:25:55 +02:00
Elias Lecomte 8819844740 Fix single-day selection in the date range picker (#55718)
* Fix single-day selection in the date range picker

* Limit single-tap date selection to devices without hover
2026-11-10 08:23:21 +02:00
WendelinandClaude Opus 5.5 008adf1533 Move the create helper dialog and helper forms to contexts (#55794)
* Narrow helper create and area update data functions to the API they use

The create helper dialog can then pass the API context instead of the
full hass object.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eHviQBgc6SiiNrMfyY

* Consume contexts in helper forms instead of hass

The helper forms only read translations, locale and config, so they now
consume the internationalization and config contexts. This avoids
rerendering them on every unrelated hass change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eHviQBgc6SiiNrMfyY

* Consume contexts in the create helper dialog instead of hass

The dialog reads translations, config, the API and the connection from
their contexts and no longer passes hass to the helper forms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eHviQBgc6SiiNrMfyY

* Refactor API calls to use HomeAssistantApi for improved type safety and consistency across data handling

---------

Co-authored-by: Claude <[email protected]>
2026-11-09 20:54:31 +01:00
renovate[bot] 8c3d0f2f1e Update dependency serve to v14.2.7 (#55810)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-09 20:52:23 +01:00
renovate[bot] 3f4f89480f Update tsparticles to v4.5.3 (#55811)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-09 19:51:19 +00:00
Matthias de BaatandClaude Opus 5.5 432762a2ea Add design to the AI policy (#55795)
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-09 20:45:01 +01:00
WendelinandClaude Opus 5.5 013cf8d7e6 Give automation editor rows a config path (#55801)
* Give automation editor rows a config path

Each list and row in the automation and script editor extends the path
of its ancestor with its own segment through a Lit context, e.g.
["actions", 0, "then", 1]. Rows that open in the sidebar register in a
per-editor registry by path, as groundwork to find the row a config path
belongs to, e.g. to point at an error in it.

Move the generic path type and helpers from the Lovelace editor to
common/util/config-path and use ConfigPath everywhere.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Test config path helpers on their own

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-09 20:17:34 +02:00
Joost LekkerkerkerandClaude 1de489cca9 Sort device connections by type in device info card (#55797)
Claude-Session: https://claude.ai/code/session_01SLHDn4zYGvMHi4C8v3m45c

Co-authored-by: Claude <[email protected]>
2026-11-09 16:58:30 +01:00
Maarten Lakerveld 97af661779 Use the Backups menu caption as the backup page title (#55799)
The Settings > System menu said "Backups" while the page header said
"Backup". Reuse the caption key like the other system pages do, so
the two can't drift apart again.
2026-11-09 16:41:09 +01:00
Erwin Douna f702e369fc Add a health dialog to config entries (#55736)
* Add a health dialog to config entries

* Address review feedback

* Address review feedback

* Address review feedback

* Address review feedback

* Use the integration filter for the logs link
2026-11-09 16:40:04 +01:00
Maarten Lakerveld 78e0a92ddd Include disabled helpers in the helpers area filter (#55796)
The helpers table lists disabled helpers, but its area filter left them
out, so a disabled helper without an area disappeared when picking
No area, and one in an area disappeared when picking that area. Match
the entities page, which already passes include-disabled-entities.
2026-11-09 16:24:11 +01:00
Andreas d742259444 Fix stale color and slider jump after quick drag in light color pickers (#55780)
* Fix stale color sent after quick drag in light color pickers

When the color temperature slider is dragged and released within the
500 ms throttle window, the release handler skipped sending because the
picker value already equalled the final value, relying on the pending
throttled call. A state update from the leading throttled call then
reset the picker value (no longer interacting), so the trailing call
sent the stale initial value and the light ended up at the wrong color
temperature.

Cancel the pending throttled call on release and always send the final
value. Apply the same cancel to the RGB picker, where a pending trailing
call could send a stale color after the final one.

* Keep released value in light color pickers until state settles

After release, keep showing the released value for a short time and
ignore state updates in between, so that late state updates from calls
sent while dragging no longer make the slider jump back before the
final value is reported.

* Don't sync light color pickers while a new drag is active

If a new drag starts before the release hold of the previous one ends,
the hold timer must not overwrite the picker value with the reported
state, as that makes the control jump and lets a pending throttled call
send the older value. The release of the new drag starts a new hold.

* Address review: keep brightness normalization in sync, hold native input

Keep the brightness normalization of RGB-only lights in sync with the
reported state while the picker values are held (during a drag or the
release hold), as it is applied to the next color sent. Otherwise
successive color selections could dim the light repeatedly.

The native color input has no release event and sends throttled, so
refresh the release hold on every input. This keeps state updates from
calls sent while picking from overwriting the pending value.

* Use PendingValueSync in light color pickers and end interaction on release

Replace the fixed release hold timer with PendingValueSync, so state
updates are ignored only while a call is queued or in flight. Also clear
_isInteracting in the release handlers, so a keyboard adjustment or a
cancelled pan no longer stops the picker from following the state.
2026-11-09 16:22:09 +01:00
OllieandClaude Opus 5.5 623ca14356 Configure remote Bluetooth adapters from the adapters page (#55742)
* Configure remote Bluetooth adapters from the adapters page

Remote scanners such as ESPHome Bluetooth proxies have their scanning
mode and other settings in the options flow of the integration that
provides them. Show the configure button for remote adapters on the
Bluetooth adapters page and open that integration's options flow, found
through the scanner device's via device, so users no longer have to find
the device under Devices & services.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ALzdAQkZAy37oGWd7GMtbQ

* Prefer the providing integration's device when finding the source entry

Other integrations may add config entries to the scanner's own device,
so look at the via device first and only fall back to the scanner's
device.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ALzdAQkZAy37oGWd7GMtbQ

* Only use the via device and skip disabled source entries

Drop the fallback to the scanner's own device, which could pick up an
unrelated integration's entry, and don't offer to configure a remote
adapter whose providing config entry is disabled or has no options flow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ALzdAQkZAy37oGWd7GMtbQ

* Check for a configurable source entry in the template

Keep _getSourceConfigEntry a plain lookup, as suggested in review, and
skip the cog for disabled or non-configurable source entries where it
is rendered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ALzdAQkZAy37oGWd7GMtbQ

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-09 16:10:41 +01:00
Bram Kragten e32bc0696e Bumped version to 20261028.5 2026-11-06 15:14:00 +01:00
WendelinandClaude Opus 5.5 6327304f4d Fix bright card outlines on Shelly Wall Display (#55704)
* Keep rgba() colors in the legacy CSS build

Raising the legacy floor to Chrome 67 lets lightningcss rewrite rgba()
to 8-digit hex (#rrggbbaa), since Chrome 62 supports it. Kiosk webviews
like the Shelly Wall Display get the legacy build but can't parse that,
so var(--divider-color) borders on cards, toggles and buttons fell back
to currentColor and showed as bright outlines, the same symptom as
#52986. Always compile hex alpha colors to rgba() in legacy builds, for
both css`` templates and imported stylesheets. Modern builds are
unchanged.

Also drop the loader's redundant /* global */ header, which ESLint now
rejects because module and require are already built-in globals in
.cjs files.

Fixes #55699

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eGHbhPo6Q2xNuKcJen

* Also keep rgba() colors in the legacy service worker build

The template loader runs with the legacy-sw browserslist env for the
service worker layer, which an exact match on legacy missed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eGHbhPo6Q2xNuKcJen

---------

Co-authored-by: Claude <[email protected]>
2026-11-06 15:12:17 +01:00
Petar Petrov 11c79e09e9 Fit narrow chart legends to three rows instead of two (#55697) 2026-11-06 15:12:16 +01:00
Paul Bottein 5060b37381 Fix truncated buttons in the voice assistant setup (#55677) 2026-11-06 15:12:14 +01:00
Aidan Timson 63e3a04f15 Fix the max-age of the demo and cast cache headers (#55676) 2026-11-06 15:12:13 +01:00
Aidan Timson 818de1da8e Render full dashboards with their tabs in the demo embed (#55640)
* Add an embedded mode to hui-root that leaves the page's URL alone

* Add a dashboard component to the demo embed

* Keep embedded dashboards' back navigation, height and sidebar tabs inside the embed

* Follow anchors, replacements and new configs in embedded dashboards

* Go back past a followed back_path in embedded dashboards

* Isolate embedded view containers so view backgrounds show

* Match decoded and aliased views and skip empty embedded dashboards

* Read the sidebar tab once sections views have their dashboard

* Declare the navigate events in HTMLElementEventMap

* Skip the Lovelace info fetch and its mock in embedded dashboards
2026-11-06 15:12:11 +01:00
Aidan Timson 70897feab1 Render views and dashboard strategies in the demo embed (#55639)
* Add a view component to the demo embed

* Show only the latest generated dashboard in the demo embed

* Stop stale and repeated strategy results in embedded views

* Draw view themes and backgrounds in embedded views
2026-11-06 15:12:10 +01:00
Aidan Timson f827c09e72 Let embed entities set their entity registry options (#55675) 2026-11-06 15:09:48 +01:00
Aidan Timson a4bb97b71c Render sections in the demo embed, with a device registry (#55638)
* Share embed provider lookup and theme in a base element

* Add devices to the demo embed provider

* Add a section component to the demo embed

* Draw section backgrounds and accept more section configs in the demo embed
2026-11-06 15:09:43 +01:00
puddly 509561aabe Allow the ESPHome serial proxy URL to be null (#55665)
* Allow the ESPHome serial proxy URL to be None

* Clarify comment
2026-11-06 14:58:14 +01:00
Christian Wiedel 0446eb5a62 Fix wrapped flow dialog titles overlapping the subtitle (#55661) 2026-11-06 14:58:13 +01:00
Paul Bottein e815c44a42 Fix area controls freezing large dashboards (#55650) 2026-11-06 14:58:11 +01:00
Joost LekkerkerkerandClaude Opus 5.5 4551a87a7a Label marketplace open issue count as issues and pull requests (#55635)
* Label marketplace open issue count as issues and pull requests

The GitHub open issues count includes pull requests. Rename the
translation keys and update the English strings so the label matches
the number shown.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Update marketplace tests for the renamed open issues keys

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-06 14:58:10 +01:00
Alexander Hass 23e376c7b4 Resolve external statistics in the History panel (#55521)
* Resolve external statistics in the History panel

The History panel plots external statistics (`<domain>:<object_id>`), for example when the statistics graph card links to it, but treated them as entities everywhere else.

- The sources picker looks up an external statistic in the statistics metadata and shows its name instead of "Entity not found".
- Statistics without an entity take name and unit from their metadata, so the legend and tooltip no longer show the prettified ID without a unit.
- External statistic IDs are no longer sent to `history/stream`. Core rejects the whole subscription for an ID that is not an entity ID, which dropped the state history of every other picked entity.

* Use statistic metadata only for external statistics

The statistics of a removed entity got the unit from their metadata, but no device class. Its recent state history has the same unit and a device class, so both ended up in separate charts and the overlap was no longer trimmed. Other statistics keep a blank unit again and merge into the history line of their entity. The metadata is only fetched for external statistics.

* Reset the zoom when only external statistics remain

Removing the last entity from a zoomed view returned before the zoom was reset. The chart was rebuilt at full range, but the zoom slider kept the previous range.

* Reset the chart zoom when only external statistics are shown

Charts of external statistics stay mounted when the date range changes, because there is no state history to load. Resetting only the zoom range left the chart zoomed while the reset button was disabled. The zoom is now reset on the charts as well, and the normal path is unchanged again.

* Keep the statistics when the metadata lookup fails

A failed metadata lookup rejected the whole request, so the fetched statistics were dropped and the panel could stay on the loading spinner. External statistics are now shown under their ID instead.

* End the loading when the statistics request fails

With only external statistics selected there is no state history, so a failed statistics request left the panel on the loading spinner. A failed request now sets an empty result, guarded by the fetch ID so that an older request cannot overwrite newer data.

* Show external statistics like the statistic picker and inline the stream filter

The sources picker row of an external statistic gets the chart line icon and the source integration as context, as in ha-statistic-picker, instead of the default entity icon. The filter for the history stream has a single caller, so it is inlined in the History panel and its export and test are dropped. The comment on the blank unit of other statistics moves to the isExternalStatistic check it describes.

* Clear the previous statistics before fetching new ones in the History panel

Switching from one external statistic to another kept the chart of the previous one on screen and in the download until the new request was done, as no state history shows the loading then. The statistics are now cleared before the request, so the panel shows its loading state instead.
2026-11-06 14:58:09 +01:00
Bram Kragten a67b691a45 Bumped version to 20261028.4 2026-11-04 12:05:25 +01:00
Franck Nijhof fc0f86e46d Add Marketplace download source menu item for the China mirrors (#55615) 2026-11-04 12:04:21 +01:00
Aidan Timson ef6438a77d Fix the demo embed for the contributors site (#55596) 2026-11-04 12:03:30 +01:00
WendelinandClaude Opus 5.5 7b4981e850 Add descriptive aria-labels to picker filter chips (#55592)
* Give picker section filter chips a descriptive aria-label

Screen readers announced the section chips in quick search and the
target picker only by their visible text (e.g. "Navigate"), which gives
no hint that the button filters the results. Label them as
"Filter: <section>" instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eFvrHAAoLcdEeqDAUg

* Fix fallback for section label localization in ha-picker-combo-box

---------

Co-authored-by: Claude <[email protected]>
2026-11-04 11:53:19 +01:00
Maarten Lakerveld a46e90de67 Stop recomputing active system domains on every state change in the add element dialog (#55586) 2026-11-04 11:31:19 +01:00
3dfadb7fdf Let core work out what target exclusions take out (#55585)
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Claude Fable 5.1 <[email protected]>
2026-11-04 11:25:33 +01:00
Paul Bottein 6f3ef16d20 Add an option to include pre-releases in Marketplace repositories (#55567) 2026-11-04 11:01:42 +01:00
17d08d26f6 Wrap long descriptions in the entity settings (#55590)
* Wrap supporting text of entity settings rows

Long explanations such as the visibility description were truncated
with an ellipsis, especially in languages with longer translations.

Fixes #55584

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Kv7eGRG4gEJgUauHeEZcB

* Update supporting-text styles for row and list items

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
2026-11-03 14:34:40 +01:00
Alexander Hass aa06e8ce25 Fix README images and links with a relative path in the Marketplace (#55525)
* Keep relative README addresses for the Marketplace rewrite

Images and links in a README with a plain relative path, such as `images/logo.png`, were broken on the Marketplace repository page. xss empties every `src` and `href` that does not start with a scheme, `/`, `./`, `../` or `#`, so the path was gone before `rewriteHtmlUrls` could point it at the repository.

`renderMarkdown` takes `allowRelativeUrls`, which `ha-markdown-element` sets when it rewrites the addresses afterwards. Such an address of a link, image or source is kept as a path below the current one, so it can never carry a scheme, and xss checks it like any other address.

* Trim a relative README address before it gets the ./ prefix

xss trims the spaces written around an attribute value, but not encoded ones. A relative path such as `&#32;images/logo.png` therefore got the space inside the path after the ./ prefix, and the image stayed broken. The value is now decoded and trimmed first, as the browser trims the address.

* Decode a relative README address once and keep data links first

The relative address was decoded before `safeAttrValue` decoded it again, so `&#38;#105;mages` was checked and shown as `images` while the browser reads `&#105;mages`. Like `srcset`, it is now decoded once with `&amp;` for query strings, dropped when entities are left over, and written back escaped, so the browser reads the path that was checked.

Links to data URLs allowed with `allowDataUrl` are handled before relative addresses again, so they are no longer turned into paths.

* Escape a kept relative README address only once

`safeAttrValue` returns the value escaped already, so escaping its result again turned a quote in a path into `&amp;quot;`, and the browser requested another file. It is now only the check, and the decoded path is escaped once, like `srcset`.

The comments of the change are cut down to the one above the new function, as the code around has few.

* Drop relative README addresses with a scheme and reuse URL_ATTRIBUTES

A relative path never has a scheme, so an address xss empties that still has one after decoding (HTTPS://..., j:alert(1) from &#0000106avascript:) or is empty is dropped instead of being kept below ./, where it would request a path in the repository that does not exist. The worker imports URL_ATTRIBUTES from rewrite-html-urls, so the attributes it keeps and the ones the rewrite touches cannot drift apart.
2026-11-03 14:34:39 +01:00
Bram Kragten 122877cdf5 Bumped version to 20261028.3 2026-11-02 16:42:17 +01:00
Josef Zweck a103eac243 Add access risk to the Marketplace warning (#55559) 2026-11-02 16:41:33 +01:00
Paul Bottein a9a8a9aad9 Show the area first in integration device rows (#55557) 2026-11-02 16:41:32 +01:00
WendelinandClaude Opus 5.5 35a054c1ba Fix picker rows missing the first click after scrolling (#55556)
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Claude <[email protected]>
2026-11-02 16:41:31 +01:00
960e99ed66 Refactor bulk delete labels (#55555)
Co-authored-by: Bram Kragten <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
2026-11-02 16:41:29 +01:00
Paul Bottein 232375befb Limit the more info activity to the 100 most recent entries (#55553) 2026-11-02 16:41:28 +01:00
Aidan Timson 91ee29a2e6 Use generic picker for install another version (#55552) 2026-11-02 16:41:26 +01:00
Aidan Timson a6dc5d0008 Shorten the Marketplace description on the settings page (#55549) 2026-11-02 16:41:25 +01:00
Thomas Mueller 7a66de362e Seek on slider change in the media control card (#55542)
* Seek on slider change in the media control card

A touch drag ends without a click, so the card never seeked after a
drag. Use the slider's change event, which fires when a drag or tap
ends and on arrow keys.

* Remove media control card rendering test

The frontend testing guidance asks for tests of code that computes
something, not rendering tests.
2026-11-02 16:41:23 +01:00
Thomas Mueller 36500e5b19 Fix media progress slider on Chromium < 125 (#55539)
matches(":state(dragging)") throws before Chromium 125. Use
customStates.has("dragging") instead.
2026-11-02 16:41:22 +01:00
karwosts df88136147 Fix date-only attribute formatting to not shift into other days (#55536) 2026-11-02 16:41:21 +01:00
jimjaeger 2f1d738c2c Fix onboarding using US customary units when the location is detected (#55535)
Keep the detected unit system in onboarding
2026-11-02 16:41:19 +01:00
Paulus SchoutsenandClaude bfeb26b47d Link the MCP integration pages to the AI settings (#55515)
The AI settings show how to connect to the MCP server and the URL of
each of its APIs. The MCP client and MCP server integration pages now
have an "AI settings" button that opens the MCP card on that page. The
button is the primary action when the page has no "Add entry" button.

The AI settings page scrolls to the section named in the URL hash, like
the backup settings page, and clears the hash after. In the demo, the
hash is the route of the page, so the button links to the page without
a section and the page keeps a hash that names no section.


Claude-Session: https://claude.ai/code/session_01EzDS5Gc7EVw1NsLpEB7yza

Co-authored-by: Claude <[email protected]>
2026-11-02 16:41:18 +01:00
Joost LekkerkerkerandClaude 8de5bfee89 Stretch chip container to fill host so outline matches host shape (#55510)
Co-authored-by: Claude <[email protected]>
2026-11-02 16:41:17 +01:00
Jan-Philipp BeneckeandCopilot Autofix powered by AI 1efc7f8a95 Fix network graph button spacing (#55501)
* Fix zoom reset button spacing

* Replace margin-right with margin-inline-end

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* Align with chart-base

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
2026-11-02 16:41:15 +01:00
Erwin DounaandAidan Timson 9e0d38fba8 Show a skeleton while the live log loads (#55443)
Co-authored-by: Aidan Timson <[email protected]>
2026-11-02 16:41:13 +01:00
2932f8f528 Add embeddable dashboard card components to the demo (#54348)
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Aidan Timson <[email protected]>
2026-11-02 16:41:12 +01:00
Bram Kragten 6a0902d18c Bumped version to 20261028.2 2026-10-30 23:57:41 +01:00
Paul Bottein 4424f98eb6 Add translation for the Marketplace panel title (#55486) 2026-10-30 23:57:29 +01:00
Maarten Lakerveld ea13594fb0 Move the panel background stacking context off partial-panel-resolver (#55485)
Since #54801 the resolver creates a stacking context (isolation: isolate) so
its fixed ::before background sits behind the panel. The resolver is rendered
conditionally, once the startup data is available, and isolating it can
intermittently leave the Android WebView accessibility tree (Chromium
109-124) with an empty panel subtree while the page paints normally. UI
automation then never sees the dashboard; the companion app nightly E2E has
hit this on the legacy build (API 32/33/35) since the change landed.

Move the isolation to home-assistant-main's host, which exists before the
resolver is rendered. The pseudo-element and the Lovelace view background
both stay at z-index -1 in that context, in the same order as before, so the
themed background behaves exactly as #54801 intended. Measured with Maestro
on a Chrome 109 emulator: 0 stale trees in 62 cold loads, against 11 in 100
with the isolation on the resolver.
2026-10-30 23:57:28 +01:00
Daan Vervacke ce726a8a3f Wrap long title in YAML-only integration dialog (#55481) 2026-10-30 23:57:26 +01:00
Paul Bottein d67479da6d Replace hide-zoom-controls with a zoom slider mode on charts (#55468) 2026-10-30 23:57:25 +01:00
Bram Kragten 275e30879c Bumped version to 20261028.1 2026-10-29 16:44:20 +01:00
Maarten Lakerveld 7b53005865 Load the legacy Intl polyfills once per page and bundle PluralRules with its data (#55452)
Each legacy entry bundle carries its own copy of intl-polyfill.ts, so the
module-level guard only stopped re-runs within one bundle. With the bundles
loading in parallel, the second bundle could probe Intl.PluralRules after the
first had installed the polyfill but before its locale data chunk arrived. The
FormatJS should-polyfill probe calls select(), which throws on a data-less
polyfill, rejecting the top-level await so the entry never evaluated. On the
companion app this surfaces as ExternalBusTimeout on old WebViews.

Share one promise per page on globalThis so every bundle waits for the same
run, and import the PluralRules polyfill and its English data from one module
so Intl.PluralRules is never installed without data.
2026-10-29 16:43:58 +01:00
Paul Bottein 94950fcacd Show a toast with a link to the dashboard after adding to it (#55444) 2026-10-29 16:43:56 +01:00
Petar Petrov 4214fe46c6 Name new disk mounts after the partition's volume label (#55441) 2026-10-29 16:43:55 +01:00
Aidan Timson d6325eef7d Fix the Marketplace search field overlapping the top bar icons on narrow screens (#55439)
Let the narrow data table search field shrink to fit
2026-10-29 16:43:54 +01:00
WendelinandClaude Opus 5.5 12e722f122 Wrap long text in debug tool and network discovery rows (#55438)
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Claude <[email protected]>
2026-10-29 16:43:53 +01:00
Paul Bottein 83eb3ca13a Use the state color by default in alert cards and badges (#55436) 2026-10-29 16:43:51 +01:00
Petar Petrov 0532b1f5f6 Ignore YAML dashboard update event on first load (#55430) 2026-10-29 16:43:50 +01:00
Tristan Cartledge 970afb588d Fix duplicated hidden areas when reordering areas in the areas dashboard editor (#55424) 2026-10-29 16:43:49 +01:00
Maarten Lakerveld 23137ce6d2 Name maintenance problem tiles after the device and the entity (#55420)
Problem binary sensors were added to the maintenance view using the
battery tile builder, which names every tile after its device. A device
with several problem sensors (overheating, overvoltage, ...) then showed
identical tiles. Problem tiles now use a device plus entity name; the
entity part is dropped automatically when the sensor has no name of its
own, so single-sensor devices still read as just the device name.
Battery tiles keep the device-only name.

Fixes home-assistant/frontend#55413
2026-10-29 16:43:48 +01:00
JonathanandXyolyp 6b022d63e8 Preselect the only allowed unit also in an optional unit selector (#55417)
Co-authored-by: Xyolyp <[email protected]>
2026-10-29 16:43:46 +01:00
Paul Bottein d3c6e132b7 Show multi-select chips in a field with an inline add button (#55416) 2026-10-29 16:43:45 +01:00
Paul Bottein c08b261d4b Keep the section row divider under the entities card header (#55415) 2026-10-29 16:43:44 +01:00
Bram KragtenandClaude Opus 5.5 0721b22036 Keep the device and area page headers fixed while scrolling (#55409)
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-10-29 16:43:43 +01:00
819 changed files with 45777 additions and 15845 deletions

No files matched your search

+2 -28
View File
@@ -1,6 +1,6 @@
---
name: ha-frontend-components
description: Home Assistant frontend component patterns. Use when implementing or reviewing dialogs, ha-form, ha-alert, loading states, keyboard shortcuts, tooltips, panels, Lovelace cards, or ha-button usage.
description: Home Assistant frontend component patterns. Use when implementing or reviewing dialogs, ha-form, ha-alert, keyboard shortcuts, tooltips, panels, Lovelace cards, or ha-button usage.
---
# HA Frontend Components
@@ -93,33 +93,7 @@ html`
## Loading States
Pick the indicator by what is loading, following the [Loading pattern](https://contributors.home-assistant.io/design/patterns/loading/):
- Use a skeleton from `src/components/skeleton/` (`ha-skeleton`, `ha-skeleton-text`, `ha-skeleton-icon`) when content loads into a layout you already know, such as table rows, tile text, or a log. It holds the layout, so nothing jumps when the content arrives.
- Use `ha-spinner` only when a whole area loads and its shape is unknown.
- Use `ha-button` with `loading`, or `ha-progress-button`, for an action started from a button. Don't put a separate spinner next to it.
Wrap the indicator in `ha-fade-in` from `src/components/animation/ha-fade-in.ts`:
- Fade a skeleton in straight away over about 300ms (`.duration=${300}`), as the data table does. It stands in for the content, so a delay would leave an empty gap.
- Delay a spinner or progress bar, usually by `.delay=${500}`, so a load that finishes within that time never flashes it. Some slower areas, such as backups and updates, use `${1000}`.
- Don't fade in the loaded content itself.
Give a skeleton group the `progressbar` role and a translated label, as `ha-spinner` has, rather than visible "Loading" text. A loading state always ends in the content, an empty state, or an error.
```ts
html`
<ha-fade-in .duration=${300} easing="ease-in">
<div
role="progressbar"
aria-label=${this._i18n.localize("ui.common.loading")}
>
<ha-skeleton-text></ha-skeleton-text>
</div>
</ha-fade-in>
<ha-fade-in .delay=${500}><ha-spinner></ha-spinner></ha-fade-in>
`;
```
Load `ha-frontend-loading` for anything that shows while content loads: skeletons, spinners, loading buttons and fades.
## Shortcuts And Tooltips
@@ -0,0 +1,75 @@
---
name: ha-frontend-loading
description: Home Assistant frontend loading states. Use when adding, changing or reviewing anything that shows while content loads, such as a skeleton, spinner, loading button or loading fade, or when checking how a screen looks while it loads.
---
# HA Frontend Loading
Use this skill for every loading state, following the [Loading pattern](https://contributors.home-assistant.io/design/patterns/loading/). A loading state always ends in the content, an empty state, or an error.
## Pick The Indicator
- Use a skeleton from `src/components/skeleton/` (`ha-skeleton`, `ha-skeleton-text`, `ha-skeleton-icon`, `ha-skeleton-log`) when content loads into a layout you already know, such as table rows, tile text, or a log. It holds the layout, so nothing jumps when the content arrives.
- Use `ha-spinner` only when a whole area loads and its shape is unknown.
- Use `ha-button` with `loading`, or `ha-progress-button`, for an action started from a button. Don't put a separate spinner next to it.
## The Wave
Every skeleton uses the same soft wave (`ha-skeleton`'s default `effect="sheen"`). It's one slanted wave across all the skeletons on the page, from the top corner of the content on the side text starts from to the opposite bottom corner, which each skeleton shows its slice of, on one shared clock. It flows from one skeleton into the next, starts its next sweep as soon as it leaves the content, and a skeleton added mid-sweep joins in rather than starting over. Reduced motion stops it.
Don't change the effect or speed (`--ha-skeleton-duration`) for one component.
## Showing A Skeleton
Make the skeleton the same shape and size as the content it stands for: one text skeleton per line of text, an icon skeleton per icon, a block per image or chart.
Wrap the indicator in `ha-fade-in` from `src/components/animation/ha-fade-in.ts`:
- Fade a skeleton in straight away over about 300ms (`.duration=${300}`), as the data table does. It stands in for the content, so a delay would leave an empty gap.
- Delay a spinner or progress bar, usually by `.delay=${500}`, so a load that finishes within that time never flashes it. Some slower areas, such as backups and updates, use `${1000}`.
- Don't fade in the loaded content itself.
Give a skeleton group the `progressbar` role and a translated label, as `ha-spinner` has, rather than visible "Loading" text.
```ts
html`
<ha-fade-in .duration=${300} easing="ease-in">
<div
role="progressbar"
aria-label=${this._i18n.localize("ui.common.loading")}
>
<ha-skeleton-text></ha-skeleton-text>
</div>
</ha-fade-in>
<ha-fade-in .delay=${500}><ha-spinner></ha-spinner></ha-fade-in>
`;
```
## Checking It
Check a loading state in the browser, not only by reading the code. These work on any setup: a dev server, the demo, or the gallery.
- **Hold the loading state.** Home Assistant's data comes over the WebSocket, which DevTools network throttling doesn't slow. Hold the replies back from the console instead, then open the screen from inside the app (not a reload, which drops the patch). Adjust the pattern to the messages the screen waits on:
```js
const conn = document.querySelector("home-assistant").hass.connection;
const slow = (type = "") => /^(recorder|history|logbook)\//.test(type);
const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
const send = conn.sendMessagePromise.bind(conn);
conn.sendMessagePromise = async (msg) => {
const result = await send(msg);
if (slow(msg.type)) await wait(3000);
return result;
};
const subscribe = conn.subscribeMessage.bind(conn);
conn.subscribeMessage = (callback, msg, options) => {
if (!slow(msg.type)) return subscribe(callback, msg, options);
const due = Date.now() + 3000;
const later = (message) =>
setTimeout(() => callback(message), Math.max(0, due - Date.now()));
return subscribe(later, msg, options);
};
```
- **Compare before and after.** Take screenshots of the same screen on `dev` and on your branch, at the same viewport size, both loading and loaded, and put them side by side. In a pull request, show both.
- **Check every look.** Light and dark themes, a right-to-left language (the wave starts from the right), reduced motion (DevTools, Rendering, "Emulate CSS media feature prefers-reduced-motion": the wave stops), and a phone width (DevTools device toolbar).
+1
View File
@@ -1,6 +1,7 @@
FROM mcr.microsoft.com/devcontainers/python:3.14
ENV \
COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
DEBIAN_FRONTEND=noninteractive \
DEVCONTAINER=true \
PATH=$PATH:./node_modules/.bin
+1 -1
View File
@@ -25,7 +25,7 @@ jobs:
name: Verify actions lockfile
runs-on: ubuntu-latest
env:
GH_ACTIONS_LOCK_VERSION: v0.4.1
GH_ACTIONS_LOCK_VERSION: v0.5.1
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+17 -17
View File
@@ -18,7 +18,7 @@ workflows:
- 'actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9'
'.github/workflows/codeql-analysis.yaml':
- 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'
- 'github/codeql-action@9b3254085494b55a0f7c4c2b3d2d52cc712ce370'
- 'github/codeql-action@33d7b85da1a04171e211befe2c739303b9a4c066'
'.github/workflows/copilot-setup-steps.yml':
- 'actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9'
- 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'
@@ -64,13 +64,13 @@ workflows:
'.github/workflows/relative-ci.yaml':
- 'relative-ci/agent-action@711f3a8fa1b928e6afde280011110c9b0a224a60'
'.github/workflows/release-drafter.yaml':
- 'release-drafter/release-drafter@978bb0b30c5ee8cdd332ced253758157150d43f0'
- 'release-drafter/release-drafter@d1a19e60e81a7e650d00a7de9277f87e439117ea'
'.github/workflows/release.yaml':
- 'actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9'
- 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'
- 'actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1'
- 'actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0'
- 'home-assistant/actions@86d4564712fa02543c808e3a693dd04f9d3f8361'
- 'home-assistant/actions@2026.11.0'
- 'home-assistant/wheels@9e17ab1ed5c4c79d8b61e29fa63de25ca2710716'
- 'pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086'
'.github/workflows/restrict-task-creation.yaml':
@@ -82,12 +82,12 @@ workflows:
- 'actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9'
- 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'
- 'actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1'
- 'peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1'
- 'peter-evans/create-pull-request@3ffccacd46053766916f087ce41d627c0b8cf2d1'
'.github/workflows/sync-sensor-entity-constants.yaml':
- 'actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9'
- 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'
- 'actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1'
- 'peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1'
- 'peter-evans/create-pull-request@3ffccacd46053766916f087ce41d627c0b8cf2d1'
'.github/workflows/translations.yaml':
- 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'
dependencies:
@@ -151,14 +151,14 @@ dependencies:
commit: 'sha1-89ae32b08ed1a541efecbab17912962a5e38981c'
owner_id: 7513068
repo_id: 113918130
'github/codeql-action@9b3254085494b55a0f7c4c2b3d2d52cc712ce370':
ref: 'v4.39.1'
commit: 'sha1-9b3254085494b55a0f7c4c2b3d2d52cc712ce370'
'github/codeql-action@33d7b85da1a04171e211befe2c739303b9a4c066':
ref: 'v4.39.3'
commit: 'sha1-33d7b85da1a04171e211befe2c739303b9a4c066'
owner_id: 9919
repo_id: 259445878
'home-assistant/actions@86d4564712fa02543c808e3a693dd04f9d3f8361':
ref: 'master'
commit: 'sha1-86d4564712fa02543c808e3a693dd04f9d3f8361'
'home-assistant/actions@2026.11.0':
ref: '2026.11.0'
commit: 'sha1-07f46fd2e19967768b5fd3000f91f857452b767c'
owner_id: 13844975
repo_id: 173703505
'home-assistant/wheels@9e17ab1ed5c4c79d8b61e29fa63de25ca2710716':
@@ -166,9 +166,9 @@ dependencies:
commit: 'sha1-9e17ab1ed5c4c79d8b61e29fa63de25ca2710716'
owner_id: 13844975
repo_id: 184234812
'peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1':
ref: 'v8.1.1'
commit: 'sha1-5f6978faf089d4d20b00c7766989d076bb2fc7f1'
'peter-evans/create-pull-request@3ffccacd46053766916f087ce41d627c0b8cf2d1':
ref: 'v8.1.3'
commit: 'sha1-3ffccacd46053766916f087ce41d627c0b8cf2d1'
owner_id: 18365890
repo_id: 197176365
'pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086':
@@ -183,8 +183,8 @@ dependencies:
commit: 'sha1-711f3a8fa1b928e6afde280011110c9b0a224a60'
owner_id: 43522883
repo_id: 398376354
'release-drafter/release-drafter@978bb0b30c5ee8cdd332ced253758157150d43f0':
ref: 'v7.10.0'
commit: 'sha1-978bb0b30c5ee8cdd332ced253758157150d43f0'
'release-drafter/release-drafter@d1a19e60e81a7e650d00a7de9277f87e439117ea':
ref: 'v7.11.0'
commit: 'sha1-d1a19e60e81a7e650d00a7de9277f87e439117ea'
owner_id: 58292376
repo_id: 139022359
+2 -2
View File
@@ -32,12 +32,12 @@ jobs:
persist-credentials: false
- name: Initialize CodeQL
uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
uses: github/codeql-action/init@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
with:
languages: javascript-typescript
build-mode: none
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
with:
category: "/language:javascript-typescript"
+4 -4
View File
@@ -38,7 +38,7 @@ jobs:
name: Prepare container dependencies
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.65.0-noble@sha256:6e3fb709361521eb27161606e6da6d2674e5e89fa16516cb37d6fdd91372273d
image: mcr.microsoft.com/playwright:v1.65.1-noble@sha256:1507cbfc550a63a6b7396791ca4f00df17beb56342d2447b3f106c306f525579
options: --user 1001
defaults:
run:
@@ -155,7 +155,7 @@ jobs:
- prepare-container-dependencies
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.65.0-noble@sha256:6e3fb709361521eb27161606e6da6d2674e5e89fa16516cb37d6fdd91372273d
image: mcr.microsoft.com/playwright:v1.65.1-noble@sha256:1507cbfc550a63a6b7396791ca4f00df17beb56342d2447b3f106c306f525579
options: --user 1001 --ipc=host
defaults:
run:
@@ -207,7 +207,7 @@ jobs:
- prepare-container-dependencies
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.65.0-noble@sha256:6e3fb709361521eb27161606e6da6d2674e5e89fa16516cb37d6fdd91372273d
image: mcr.microsoft.com/playwright:v1.65.1-noble@sha256:1507cbfc550a63a6b7396791ca4f00df17beb56342d2447b3f106c306f525579
options: --user 1001 --ipc=host
defaults:
run:
@@ -261,7 +261,7 @@ jobs:
- prepare-container-dependencies
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.65.0-noble@sha256:6e3fb709361521eb27161606e6da6d2674e5e89fa16516cb37d6fdd91372273d
image: mcr.microsoft.com/playwright:v1.65.1-noble@sha256:1507cbfc550a63a6b7396791ca4f00df17beb56342d2447b3f106c306f525579
options: --user 1001 --ipc=host
defaults:
run:
+1 -1
View File
@@ -19,6 +19,6 @@ jobs:
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@978bb0b30c5ee8cdd332ced253758157150d43f0 # v7.10.0
- uses: release-drafter/release-drafter@d1a19e60e81a7e650d00a7de9277f87e439117ea # v7.11.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+1 -1
View File
@@ -36,7 +36,7 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}
- name: Verify version
uses: home-assistant/actions/helpers/verify-version@86d4564712fa02543c808e3a693dd04f9d3f8361 # master
uses: home-assistant/actions/helpers/verify-version@2026.11.0
- name: Setup Node and install
uses: $/.github/actions/setup
+1 -1
View File
@@ -36,7 +36,7 @@ jobs:
run: pnpm exec prettier --write src/data/device_classes.ts
- name: Create pull request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
uses: peter-evans/create-pull-request@3ffccacd46053766916f087ce41d627c0b8cf2d1 # v8.1.3
with:
branch: chore/sync-device-classes
commit-message: Update device class constants
@@ -37,7 +37,7 @@ jobs:
run: pnpm exec prettier --write src/data/sensor_entity_constants.ts
- name: Create pull request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
uses: peter-evans/create-pull-request@3ffccacd46053766916f087ce41d627c0b8cf2d1 # v8.1.3
with:
branch: chore/sync-sensor-entity-constants
commit-message: Update sensor entity constants
+1 -1
View File
@@ -1 +1 @@
24.22.2
24.22.3
+2 -1
View File
@@ -40,7 +40,8 @@ Never run `tsc` or `pnpm lint:types` with file arguments. When `tsc` receives fi
Detailed guidance lives in `.agents/skills/<name>/SKILL.md`. Load every matching skill before detailed implementation or review. For reviews, load `ha-frontend-review` alongside all companions that apply to the changed code or behavior:
- `ha-frontend-contexts`: Lit contexts, `hass` migration, and rerender-sensitive state access.
- `ha-frontend-components`: dialogs, forms, alerts, loading states, shortcuts, tooltips, panels, and Lovelace cards.
- `ha-frontend-components`: dialogs, forms, alerts, shortcuts, tooltips, panels, and Lovelace cards.
- `ha-frontend-loading`: loading states, skeletons, spinners, loading fades, and checking how a screen looks while it loads.
- `ha-frontend-events`: event handler typing, custom event dispatch, and event-map declarations.
- `ha-frontend-types`: backend data contracts, optional schemas, shared types, assertions, and lifecycle types.
- `ha-frontend-lit`: reactive fields, DOM queries, lifecycle behavior, and render-derived state.
+8
View File
@@ -28,10 +28,18 @@ AI can be a helpful tool for writing code and documentation. However, due to the
All contributions must be reviewed and understood by the contributor before submission. You should be able to explain every change in a pull request you submit. Pull requests that appear to be unreviewed AI output will be closed without review.
## Design contributions
AI can be a helpful tool to explore ideas and build mockups and prototypes. But AI tends to give the most common answer, not the one that fits Home Assistant and its users. So we require a human who brings the point of view and owns the design decisions.
You should be able to explain the problem your design solves and why you made your choices. If a mockup or prototype was mostly generated with AI, say so when you share it. Check your work against the [design guidelines](https://contributors.home-assistant.io/design/), as AI tools often make up components, colors, or spacing that don't exist in Home Assistant. Design proposals that look like unreviewed AI output may be closed or hidden.
## Our use of AI
Some of our projects use AI tools to assist with code reviews, issue triaging, reporting, and other project management tasks. These tools may leave comments on pull requests or issues. As with any automated tooling, these comments are not always correct.
We also use AI to help keep the design system, the Figma kit, and the code in sync. The design decisions behind them are made by people.
If an AI tool leaves a comment on your contribution, treat it as you would any other review comment. If you believe it is incorrect, say so; a brief explanation is sufficient. Maintainers always have the final say. If in doubt, ask a maintainer.
## Enforcement
+107 -42
View File
@@ -157,6 +157,99 @@ async function pollProcess(lokaliseApi, projectId, processId) {
}
/* eslint-enable no-await-in-loop */
const DRAFTS_ACCEPTED_KEYS = [
// Written per language rather than translated from English, so an English edit doesn't make them outdated
"ui.components.rooms.keywords",
];
async function exportTranslations(lokaliseApi, projectId) {
const exportProcess = await lokaliseApi.files().async_download(projectId, {
format: "json",
original_filenames: false,
replace_breaks: false,
json_unescaped_slashes: true,
export_empty_as: "skip",
filter_data: ["verified"],
});
const finishedProcess = await pollProcess(
lokaliseApi,
projectId,
exportProcess.process_id
);
const bundleUrl = finishedProcess.details.download_url;
console.log(`Downloading translations from: ${bundleUrl}`);
const response = await fetch(bundleUrl);
if (response.status !== 200 && response.status !== 0) {
throw new Error(response.statusText);
}
console.log(`Extracting translations...`);
const contents = await JSZip.loadAsync(await response.arrayBuffer());
const files = {};
await Promise.all(
Object.keys(contents.files).map(async (filename) => {
const file = contents.file(filename);
if (!file) {
// no file, probably a directory
return;
}
files[filename.split("/").splice(-1)[0]] = await file.async("string");
})
);
return files;
}
async function fetchDrafts(lokaliseApi, projectId) {
const english = JSON.parse(
await fs.readFile("src/translations/en.json", { encoding })
);
const keyNames = DRAFTS_ACCEPTED_KEYS.flatMap((key) => {
const keys = key.split(".");
const drafts = keys.reduce((obj, part) => obj?.[part], english) ?? {};
return Object.keys(drafts).map((name) => [...keys, name].join("::"));
});
if (!keyNames.length) {
return [];
}
const { items } = await lokaliseApi.keys().list({
project_id: projectId,
filter_keys: keyNames.join(","),
include_translations: 1,
limit: keyNames.length,
});
return items.flatMap((key) =>
key.translations
.filter(({ translation }) => translation)
.map(({ language_iso, translation }) => ({
filename: `${language_iso}.json`,
path: key.key_name.web.split("::"),
translation,
}))
);
}
function acceptDrafts(files, drafts) {
const data = {};
drafts.forEach(({ filename, path: keyPath, translation }) => {
data[filename] ??= files[filename] ? JSON.parse(files[filename]) : {};
const parent = keyPath.slice(0, -1).reduce((obj, part) => {
obj[part] ??= {};
return obj[part];
}, data[filename]);
parent[keyPath.at(-1)] = translation;
});
Object.entries(data).forEach(([filename, content]) => {
files[filename] = JSON.stringify(content, null, 2);
});
}
gulp.task("fetch-lokalise", async function () {
let apiKey;
try {
@@ -193,52 +286,24 @@ gulp.task("fetch-lokalise", async function () {
await Promise.all(
projects.map(async ([project, projectId]) => {
try {
const exportProcess = await lokaliseApi
.files()
.async_download(projectId, {
format: "json",
original_filenames: false,
replace_breaks: false,
json_unescaped_slashes: true,
export_empty_as: "skip",
filter_data: ["verified"],
});
const finishedProcess = await pollProcess(
lokaliseApi,
projectId,
exportProcess.process_id
);
const bundleUrl = finishedProcess.details.download_url;
console.log(`Downloading translations from: ${bundleUrl}`);
const response = await fetch(bundleUrl);
if (response.status !== 200 && response.status !== 0) {
throw new Error(response.statusText);
const [files, drafts] = await Promise.all([
exportTranslations(lokaliseApi, projectId),
project === "frontend"
? fetchDrafts(lokaliseApi, projectId)
: undefined,
]);
if (drafts) {
acceptDrafts(files, drafts);
}
console.log(`Extracting translations...`);
const contents = await JSZip.loadAsync(await response.arrayBuffer());
await mkdirPromise;
await Promise.all(
Object.keys(contents.files).map(async (filename) => {
const file = contents.file(filename);
if (!file) {
// no file, probably a directory
return;
}
const content = await file.async("nodebuffer");
await fs.writeFile(
path.join(inDir, project, filename.split("/").splice(-1)[0]),
content,
{ flag: "w", encoding }
);
})
Object.entries(files).map(([filename, content]) =>
fs.writeFile(path.join(inDir, project, filename), content, {
flag: "w",
encoding,
})
)
);
} catch (err) {
console.error(err);
+3 -1
View File
@@ -50,7 +50,9 @@ const convertToJSON = async (
const encodedData = localeData.match(
/JSON\.parse\((?<data>"(?:[^"\\]|\\.)*")\)/
)?.groups?.data;
localeData = firstBlock.match(dataRegex)?.groups?.data;
localeData =
localeData.match(/\}\)\((?<data>\{.*\})\)\s*;?\s*$/s)?.groups?.data ??
firstBlock.match(dataRegex)?.groups?.data;
if (!localeData && !encodedData) {
throw Error(`Failed to extract data for language ${lang} from ${pkg}`);
}
+1 -1
View File
@@ -100,7 +100,7 @@
The easiest way to get your Home Assistant installation served over
HTTPS is by signing up for
<a href="https://www.nabucasa.com" target="_blank"
>Home Assistant Cloud by Nabu Casa</a
>Home Assistant Link by Nabu Casa</a
>.
</p>
</div>
+2 -2
View File
@@ -28,7 +28,7 @@ class HcLaunchScreen extends LitElement {
:host {
display: block;
height: 100vh;
background-color: #f2f4f9;
background-color: var(--primary-background-color, #f2f4f9);
font-size: var(--ha-font-size-2xl);
}
.container {
@@ -44,7 +44,7 @@ class HcLaunchScreen extends LitElement {
object-fit: cover;
}
.status {
color: #1d2126;
color: var(--primary-text-color, #1d2126);
}
`;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

+1 -2
View File
@@ -1,7 +1,6 @@
import type { DemoConfig } from "../types";
import { demoEntitiesArsaboo } from "./entities";
import { demoLovelaceArsaboo } from "./lovelace";
import { demoThemeArsaboo } from "./theme";
export const demoArsaboo: DemoConfig = {
authorName: "Arsaboo",
@@ -9,5 +8,5 @@ export const demoArsaboo: DemoConfig = {
name: "ARS Home",
lovelace: demoLovelaceArsaboo,
entities: demoEntitiesArsaboo,
theme: demoThemeArsaboo,
theme: { theme: "default", dark: false },
};
-1
View File
@@ -1 +0,0 @@
export const demoThemeArsaboo = () => ({});
+7 -2
View File
@@ -13,8 +13,13 @@ import type { EntityInput } from "../../../src/fake_data/entities/types";
import type { DemoAutomation, DemoConfig, DemoTheme } from "./types";
export const applyDemoTheme = (hass: MockHomeAssistant, theme: DemoTheme) => {
if (typeof theme === "function") {
hass.mockTheme(theme());
if ("vars" in theme) {
// Like a theme with only one mode in core, so the app keeps that mode
// when it applies the theme again
hass.mockTheme(
{ modes: theme.dark ? { dark: theme.vars } : { light: theme.vars } },
{ theme: "fake-data", dark: theme.dark }
);
return;
}
hass.mockTheme(null, getDemoTheme(theme));
+2
View File
@@ -48,6 +48,8 @@ class DemoHomeDashboardStrategy extends ReactiveElement {
),
};
}
static getConfigElement = HomeDashboardStrategy.getConfigElement;
}
class DemoHomeOverviewViewStrategy extends ReactiveElement {
File diff suppressed because it is too large. Load diff
+33 -28
View File
@@ -1,28 +1,33 @@
export const demoThemeJimpower = () => ({
"text-primary-color": "var(--primary-text-color)",
"primary-color": "#5294E2",
"label-badge-red": "var(--accent-color)",
"light-primary-color": "var(--accent-color)",
"primary-background-color": "#383C45",
"primary-text-color": "#FFFFFF",
"secondary-background-color": "#383C45",
"disabled-text-color": "#7F848E",
"paper-grey-200": "#414A59",
"label-badge-background-color": "#2E333A",
"sidebar-icon-color": "var(--state-icon-color)",
"table-row-background-color": "#353840",
"paper-grey-50": "var(--primary-text-color)",
"switch-checked-color": "var(--accent-color)",
"secondary-text-color": "#5294E2",
"error-color": "#E45E65",
"divider-color": "rgba(0, 0, 0, .12)",
"success-color": "#39E949",
"switch-unchecked-button-color": "var(--disabled-text-color)",
"label-badge-border-color": "green",
"card-background-color": "#434954",
"label-badge-text-color": "var(--primary-text-color)",
"switch-unchecked-track-color": "var(--disabled-text-color)",
"dark-primary-color": "var(--accent-color)",
"accent-color": "#E45E65",
"table-row-alternative-background-color": "#3E424B",
});
import { generateColorPalette } from "../../../../src/common/color/palette";
import type { DemoCustomTheme } from "../types";
const primaryColor = "#5294E2";
export const demoThemeJimpower: DemoCustomTheme = {
dark: true,
vars: {
...Object.fromEntries(generateColorPalette(primaryColor, "primary")),
"text-primary-color": "var(--primary-text-color)",
"primary-color": primaryColor,
"label-badge-red": "var(--accent-color)",
"light-primary-color": "var(--accent-color)",
"primary-background-color": "#383C45",
"primary-text-color": "#FFFFFF",
"secondary-background-color": "#383C45",
"disabled-text-color": "#7F848E",
"label-badge-background-color": "#2E333A",
"sidebar-icon-color": "var(--state-icon-color)",
"table-row-background-color": "#353840",
"secondary-text-color": "#5294E2",
"error-color": "#E45E65",
"success-color": "#39E949",
"card-background-color": "#434954",
"label-badge-text-color": "var(--primary-text-color)",
"dark-primary-color": "var(--accent-color)",
"accent-color": "#E45E65",
"table-row-alternative-background-color": "#3E424B",
"ha-card-border-radius": "20px",
"ha-card-box-shadow": "3px 3px rgba(0, 0, 0, 0.4)",
"ha-card-border-color": "rgba(100, 100, 100, 0.3)",
},
};
+30 -28
View File
@@ -1,29 +1,31 @@
import { generateColorPalette } from "../../../../src/common/color/palette";
import type { DemoCustomTheme } from "../types";
const primaryColor = "#2980b9";
// https://community.home-assistant.io/t/slate-a-new-dark-theme/86410
export const demoThemeKernehed = () => ({
"text-primary-color": "var(--primary-text-color)",
"primary-color": "#2980b9",
"label-badge-red": "var(--accent-color)",
"primary-text-color": "#FFFFFF",
"light-primary-color": "var(--accent-color)",
"primary-background-color": "#222222",
"sidebar-icon-color": "#777777",
"secondary-background-color": "#222222",
"disabled-text-color": "#777777",
"paper-grey-200": "#222222",
"label-badge-background-color": "#222222",
"table-row-background-color": "#292929",
"paper-grey-50": "var(--primary-text-color)",
"switch-checked-color": "var(--accent-color)",
"secondary-text-color": "#b58e31",
"error-color": "#b58e31",
"divider-color": "rgba(0, 0, 0, .12)",
"success-color": "#2980b9",
"switch-unchecked-button-color": "var(--disabled-text-color)",
"label-badge-border-color": "green",
"card-background-color": "#292929",
"label-badge-text-color": "var(--primary-text-color)",
"switch-unchecked-track-color": "var(--disabled-text-color)",
"dark-primary-color": "var(--accent-color)",
"accent-color": "#2980b9",
"table-row-alternative-background-color": "#292929",
});
export const demoThemeKernehed: DemoCustomTheme = {
dark: true,
vars: {
...Object.fromEntries(generateColorPalette(primaryColor, "primary")),
"text-primary-color": "var(--primary-text-color)",
"primary-color": primaryColor,
"label-badge-red": "var(--accent-color)",
"primary-text-color": "#FFFFFF",
"light-primary-color": "var(--accent-color)",
"primary-background-color": "#222222",
"sidebar-icon-color": "#777777",
"secondary-background-color": "#222222",
"disabled-text-color": "#777777",
"label-badge-background-color": "#222222",
"table-row-background-color": "#292929",
"secondary-text-color": "#b58e31",
"error-color": "#b58e31",
"success-color": "#2980b9",
"card-background-color": "#292929",
"label-badge-text-color": "var(--primary-text-color)",
"dark-primary-color": "var(--accent-color)",
"accent-color": "#2980b9",
"table-row-alternative-background-color": "#292929",
},
};
+23 -18
View File
@@ -1,18 +1,23 @@
export const demoThemeTeachingbirds = () => ({
"paper-grey-50": "var(--primary-text-color)",
"divider-color": "rgba(255, 255, 255, 0.12)",
"primary-color": "#389638",
"light-primary-color": "#6f956f",
"label-badge-red": "var(--primary-color)",
"switch-unchecked-track-color": "var(--primary-text-color)",
"card-background-color": "#4e4e4e",
"label-badge-text-color": "var(--text-primary-color)",
"primary-background-color": "#303030",
"sidebar-icon-color": "#d3d3d3",
"secondary-background-color": "#2b2b2b",
"switch-checked-color": "var(--primary-color)",
"secondary-text-color": "#389638",
"disabled-text-color": "#545454",
"paper-grey-200": "#191919",
"label-badge-background-color": "var(--secondary-background-color)",
});
import { generateColorPalette } from "../../../../src/common/color/palette";
import type { DemoCustomTheme } from "../types";
const primaryColor = "#389638";
export const demoThemeTeachingbirds: DemoCustomTheme = {
dark: true,
vars: {
...Object.fromEntries(generateColorPalette(primaryColor, "primary")),
"divider-color": "rgba(255, 255, 255, 0.12)",
"primary-color": primaryColor,
"light-primary-color": "#6f956f",
"label-badge-red": "var(--primary-color)",
"card-background-color": "#4e4e4e",
"label-badge-text-color": "var(--text-primary-color)",
"primary-background-color": "#303030",
"sidebar-icon-color": "#d3d3d3",
"secondary-background-color": "#2b2b2b",
"secondary-text-color": "#389638",
"disabled-text-color": "#545454",
"label-badge-background-color": "var(--secondary-background-color)",
},
};
+7 -1
View File
@@ -7,7 +7,13 @@ import type { ThemeSettings } from "../../../src/types";
import type { DemoArea } from "../stubs/area_registry";
import type { DemoFloor } from "../stubs/floor_registry";
export type DemoTheme = ThemeSettings | (() => Record<string, string> | null);
export interface DemoCustomTheme {
/** The vars are applied on top of the default dark or light theme */
dark: boolean;
vars: Record<string, string>;
}
export type DemoTheme = ThemeSettings | DemoCustomTheme;
export interface DemoAutomation {
config: ManualAutomationConfig & { id: string; alias: string };
-88
View File
@@ -1,88 +0,0 @@
/* eslint-disable */
import { LitElement } from "lit";
import "./card-tools";
class CardModder extends LitElement {
setConfig(config) {
if (!window.cardTools)
throw new Error(
`Can't find card-tools. See https://github.com/thomasloven/lovelace-card-tools`
);
window.cardTools.checkVersion(0.2);
if (!config || !config.card) {
throw new Error("Card config incorrect");
}
if (Array.isArray(config.card)) {
throw new Error("It says 'card', not 'cardS'. Remove the dash.");
}
this._config = config;
this.card = window.cardTools.createCard(config.card);
this.templated = [];
this.attempts = 0;
}
render() {
return window.cardTools.litHtml`
<div id="root">${this.card}</div>
`;
}
firstUpdated() {
this._cardMod();
}
_cardMod() {
if (!this._config.style) return;
let target = null;
target = target || this.card.querySelector("ha-card");
target =
target ||
(this.card.shadowRoot && this.card.shadowRoot.querySelector("ha-card"));
target =
target ||
(this.card.firstChild &&
this.card.firstChild.shadowRoot &&
this.card.firstChild.shadowRoot.querySelector("ha-card"));
if (!target && !this.attempts)
// Try twice
setTimeout(() => this._cardMod(), 100);
this.attempts++;
target = target || this.card;
for (var k in this._config.style) {
if (window.cardTools.hasTemplate(this._config.style[k]))
this.templated.push(k);
this.card.style.setProperty(k, "");
target.style.setProperty(
k,
window.cardTools.parseTemplate(this._config.style[k])
);
}
this.target = target;
}
set hass(hass) {
if (this.card) this.card.hass = hass;
if (this.templated)
this.templated.forEach((k) => {
this.target.style.setProperty(
k,
window.cardTools.parseTemplate(this._config.style[k], "")
);
});
}
getCardSize() {
if (this._config && this._config.report_size)
return this._config.report_size;
if (this.card)
return typeof this.card.getCardSize === "function"
? this.card.getCardSize()
: 1;
return 1;
}
}
customElements.define("card-modder", CardModder);
-198
View File
@@ -1,198 +0,0 @@
/* eslint-disable */
import { html, LitElement } from "lit";
if (!window.cardTools) {
const version = 0.2;
const CUSTOM_TYPE_PREFIX = "custom:";
let cardTools = {};
cardTools.v = version;
cardTools.checkVersion = (v) => {
if (version < v) {
throw new Error(
`Old version of card-tools found. Get the latest version of card-tools.js from https://github.com/thomasloven/lovelace-card-tools`
);
}
};
cardTools.LitElement = LitElement;
cardTools.litHtml = html;
cardTools.hass = () => {
return document.querySelector("home-assistant").hass;
};
cardTools.fireEvent = (ev, detail) => {
ev = new Event(ev, {
bubbles: true,
cancelable: false,
composed: true,
});
ev.detail = detail || {};
document.querySelector("ha-demo").dispatchEvent(ev);
};
cardTools.createThing = (thing, config) => {
const _createThing = (tag, config) => {
const element = document.createElement(tag);
try {
element.setConfig(config);
} catch (err) {
console.error(tag, err);
return _createError(err.message, config);
}
return element;
};
const _createError = (error, config) => {
return _createThing("hui-error-card", {
type: "error",
error,
config,
});
};
if (!config || typeof config !== "object" || !config.type)
return _createError(`No ${thing} type configured`, config);
let tag = config.type;
if (config.error) {
const err = config.error;
delete config.error;
return _createError(err, config);
}
if (tag.startsWith(CUSTOM_TYPE_PREFIX))
tag = tag.substr(CUSTOM_TYPE_PREFIX.length);
else tag = `hui-${tag}-${thing}`;
if (customElements.get(tag)) return _createThing(tag, config);
// If element doesn't exist (yet) create an error
const element = _createError(
`Custom element doesn't exist: ${tag}.`,
config
);
element.style.display = "None";
const time = setTimeout(() => {
element.style.display = "";
}, 2000);
// Remove error if element is defined later
customElements.whenDefined(tag).then(() => {
clearTimeout(timer);
cardTools.fireEvent("rebuild-view");
});
return element;
};
cardTools.createCard = (config) => {
return cardTools.createThing("card", config);
};
cardTools.createElement = (config) => {
return cardTools.createThing("element", config);
};
cardTools.createEntityRow = (config) => {
const SPECIAL_TYPES = new Set([
"call-service",
"divider",
"section",
"weblink",
]);
const DEFAULT_ROWS = {
alert: "toggle",
automation: "toggle",
climate: "toggle",
cover: "cover",
fan: "toggle",
group: "group",
input_boolean: "toggle",
input_number: "input-number",
input_select: "input-select",
input_text: "input-text",
light: "toggle",
media_player: "media-player",
lock: "lock",
scene: "scene",
script: "script",
sensor: "sensor",
timer: "timer",
switch: "toggle",
vacuum: "toggle",
};
if (
!config ||
typeof config !== "object" ||
(!config.entity && !config.type)
) {
Object.assign(config, { error: "Invalid config given" });
return cardTools.createThing("", config);
}
const type = config.type || "default";
if (SPECIAL_TYPES.has(type) || type.startsWith(CUSTOM_TYPE_PREFIX))
return cardTools.createThing("row", config);
const domain = config.entity.split(".", 1)[0];
Object.assign(config, { type: DEFAULT_ROWS[domain] || "simple" });
return cardTools.createThing("entity-row", config);
};
cardTools.deviceID = (() => {
const ID_STORAGE_KEY = "lovelace-player-device-id";
if (window["fully"] && typeof fully.getDeviceId === "function")
return fully.getDeviceId();
if (!localStorage[ID_STORAGE_KEY]) {
const s4 = () => {
return Math.floor((1 + Math.random()) * 100000)
.toString(16)
.substring(1);
};
localStorage[ID_STORAGE_KEY] = `${s4()}${s4()}-${s4()}${s4()}`;
}
return localStorage[ID_STORAGE_KEY];
})();
cardTools.moreInfo = (entity) => {
cardTools.fireEvent("hass-more-info", { entityId: entity });
};
cardTools.longpress = (element) => {
customElements.whenDefined("action-handler").then(() => {
const longpress = document.body.querySelector("action-handler");
longpress.bind(element);
});
return element;
};
cardTools.hasTemplate = (text) => {
return /\[\[\s+.*\s+\]\]/.test(text);
};
cardTools.parseTemplate = (text, error) => {
const _parse = (str) => {
try {
str = str.replace(/^\[\[\s+|\s+\]\]$/g, "");
const parts = str.split(".");
let v = cardTools.hass().states[`${parts[0]}.${parts[1]}`];
parts.shift();
parts.shift();
parts.forEach((item) => (v = v[item]));
return v;
} catch (err) {
return error || `[[ Template matching failed ${str} ]]`;
}
};
text = text.replace(/(\[\[\s.*?\s\]\])/g, (str, p1, offset, s) =>
_parse(str)
);
return text;
};
window.cardTools = cardTools;
cardTools.fireEvent("rebuild-view");
}
+1 -1
View File
@@ -4,7 +4,7 @@ import type { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
const pipelines: AssistPipeline[] = [
{
id: "01home_assistant_cloud",
name: "Home Assistant Cloud",
name: "Home Assistant Link",
language: "en",
conversation_engine: "conversation.home_assistant",
conversation_language: "en",
+1 -1
View File
@@ -78,7 +78,7 @@ const backupConfig: BackupConfig = {
const agentsInfo: BackupAgentsInfo = {
agents: [
{ agent_id: "backup.local", name: "This device" },
{ agent_id: "cloud.cloud", name: "Home Assistant Cloud" },
{ agent_id: "cloud.cloud", name: "Home Assistant Link" },
],
};
+3 -3
View File
@@ -3,8 +3,8 @@ import type { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
export const mockConfig = (hass: MockHomeAssistant) => {
hass.mockWS<typeof validateConfig>("validate_config", () => ({
actions: { valid: true, error: null },
conditions: { valid: true, error: null },
triggers: { valid: true, error: null },
actions: { valid: true, error: null, errors: [] },
conditions: { valid: true, error: null, errors: [] },
triggers: { valid: true, error: null, errors: [] },
}));
};
@@ -44,14 +44,21 @@ export const lorawanFixtures: ConnectivityFixtures = {
],
commands: ["lorawan/"],
manifests: [
manifest("lorawan", "LoRaWAN", { integration_type: "helper" }),
manifest("lorawan", "LoRaWAN", {
config_flow: false,
integration_type: "service",
}),
manifest("sensecap_lorawan", "SenseCAP", {
integration_type: "device",
dependencies: ["lorawan"],
}),
manifest("chirpstack", "ChirpStack", { integration_type: "hub" }),
manifest("chirpstack", "ChirpStack", {
integration_type: "hub",
dependencies: ["lorawan"],
}),
manifest("thethingsnetwork_lorawan", "The Things Network", {
integration_type: "hub",
dependencies: ["lorawan"],
}),
],
configEntries: [
@@ -10,19 +10,26 @@ export const FRONIUS_ENTRY_ID = "mock-fronius";
export const RS485_PORT = "/dev/ttyUSB1";
export const modbusFixtures: ConnectivityFixtures = {
components: ["modbus"],
components: ["modbus", "flexit", "solaredge_modbus", "fronius"],
commands: ["modbus/"],
manifests: [
manifest("modbus", "Modbus", {
config_flow: false,
iot_class: "local_polling",
}),
manifest("flexit", "Flexit", {
integration_type: "device",
dependencies: ["modbus"],
iot_class: "local_polling",
}),
manifest("solaredge_modbus", "SolarEdge Modbus", {
integration_type: "device",
dependencies: ["modbus"],
iot_class: "local_polling",
}),
manifest("fronius", "Fronius", {
integration_type: "device",
dependencies: ["modbus"],
iot_class: "local_polling",
}),
],
+24 -8
View File
@@ -8,7 +8,7 @@ import type {
import type { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
export const mockEnergy = (hass: MockHomeAssistant) => {
hass.mockWS("energy/get_prefs", (): EnergyPreferences => ({
const prefs: EnergyPreferences = {
energy_sources: [
{
type: "grid",
@@ -21,7 +21,6 @@ export const mockEnergy = (hass: MockHomeAssistant) => {
entity_energy_price_export: null,
number_energy_price_export: null,
stat_rate: "sensor.power_grid",
cost_adjustment_day: 0,
},
{
type: "grid",
@@ -34,7 +33,6 @@ export const mockEnergy = (hass: MockHomeAssistant) => {
entity_energy_price_export: null,
number_energy_price_export: null,
stat_rate: "sensor.power_grid_return",
cost_adjustment_day: 0,
},
{
type: "solar",
@@ -48,6 +46,23 @@ export const mockEnergy = (hass: MockHomeAssistant) => {
stat_energy_to: "sensor.battery_input",
stat_rate: "sensor.power_battery",
},
{
type: "battery",
name: "Powerwall",
stat_energy_from_grid: "sensor.powerwall_from_grid",
stat_energy_from_solar: "sensor.powerwall_from_solar",
stat_energy_to_home: "sensor.powerwall_to_home",
stat_energy_to_grid: "sensor.powerwall_to_grid",
stat_rate: "sensor.powerwall_power",
power_config: {
stat_rate_from_grid: "sensor.powerwall_power_from_grid",
stat_rate_from_solar: "sensor.powerwall_power_from_solar",
stat_rate_to_home: "sensor.powerwall_power_to_home",
stat_rate_to_grid: "sensor.powerwall_power_to_grid",
},
stat_soc: "sensor.powerwall_battery_level",
capacity: 13.5,
},
{
type: "gas",
stat_energy_from: "sensor.energy_gas",
@@ -105,16 +120,17 @@ export const mockEnergy = (hass: MockHomeAssistant) => {
stat_consumption: "sensor.gas_heat_pump",
},
],
}));
};
hass.mockWS("energy/get_prefs", (): EnergyPreferences => prefs);
hass.mockWS("energy/info", (): EnergyInfo => ({
cost_sensors: {},
solar_forecast_domains: [],
}));
hass.mockWS("energy/validate", () => ({
energy_sources: Array.from({ length: 6 }, () => []),
device_consumption: Array.from({ length: 6 }, () => []),
device_consumption_water: Array.from({ length: 2 }, () => []),
device_consumption_gas: Array.from({ length: 2 }, () => []),
energy_sources: prefs.energy_sources.map(() => []),
device_consumption: prefs.device_consumption.map(() => []),
device_consumption_water: prefs.device_consumption_water.map(() => []),
device_consumption_gas: prefs.device_consumption_gas.map(() => []),
}));
hass.mockWS(
"energy/fossil_energy_consumption",
+75
View File
@@ -1,3 +1,30 @@
// Live power of the battery measured per direction, in W
const powerwallPower = {
from_grid: 50,
from_solar: 150,
to_home: 0,
to_grid: 0,
};
const powerEntity = (entityId: string, power: number) => ({
entity_id: entityId,
state: String(power),
attributes: {
state_class: "measurement",
unit_of_measurement: "W",
},
});
const powerwallEnergyEntity = (entityId: string, friendlyName: string) => ({
entity_id: entityId,
state: "2",
attributes: {
last_reset: "1970-01-01T00:00:00:00+00",
friendly_name: friendlyName,
unit_of_measurement: "kWh",
},
});
export const energyEntities = () =>
Object.values({
"sensor.grid_fossil_fuel_percentage": {
@@ -34,6 +61,31 @@ export const energyEntities = () =>
unit_of_measurement: "kWh",
},
},
"sensor.powerwall_from_grid": powerwallEnergyEntity(
"sensor.powerwall_from_grid",
"Powerwall charged from grid"
),
"sensor.powerwall_from_solar": powerwallEnergyEntity(
"sensor.powerwall_from_solar",
"Powerwall charged from solar"
),
"sensor.powerwall_to_home": powerwallEnergyEntity(
"sensor.powerwall_to_home",
"Powerwall discharged to home"
),
"sensor.powerwall_to_grid": powerwallEnergyEntity(
"sensor.powerwall_to_grid",
"Powerwall discharged to grid"
),
"sensor.powerwall_battery_level": {
entity_id: "sensor.powerwall_battery_level",
state: "62",
attributes: {
device_class: "battery",
friendly_name: "Powerwall battery level",
unit_of_measurement: "%",
},
},
"sensor.energy_consumption_tarif_1": {
entity_id: "sensor.energy_consumption_tarif_1",
state: "88.6",
@@ -134,6 +186,29 @@ export const energyEntities = () =>
unit_of_measurement: "W",
},
},
"sensor.powerwall_power_from_grid": powerEntity(
"sensor.powerwall_power_from_grid",
powerwallPower.from_grid
),
"sensor.powerwall_power_from_solar": powerEntity(
"sensor.powerwall_power_from_solar",
powerwallPower.from_solar
),
"sensor.powerwall_power_to_home": powerEntity(
"sensor.powerwall_power_to_home",
powerwallPower.to_home
),
"sensor.powerwall_power_to_grid": powerEntity(
"sensor.powerwall_power_to_grid",
powerwallPower.to_grid
),
"sensor.powerwall_power": powerEntity(
"sensor.powerwall_power",
powerwallPower.to_home +
powerwallPower.to_grid -
powerwallPower.from_grid -
powerwallPower.from_solar
),
"sensor.energy_gas_cost": {
entity_id: "sensor.energy_gas_cost",
state: "2",
+33 -7
View File
@@ -1,3 +1,4 @@
import type { ValidSystemDataKey } from "../../../src/data/frontend";
import type { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
import type { ThemeSettings } from "../../../src/types";
@@ -57,14 +58,40 @@ export const mockFrontend = (hass: MockHomeAssistant) => {
// eslint-disable-next-line @typescript-eslint/no-empty-function
return () => {};
});
// System data saved during this session, per key. Core starts from the
// system data of the mock hass.
const systemData: Partial<Record<ValidSystemDataKey, unknown>> = {
core: hass.systemData,
};
const systemDataCallbacks: Partial<
Record<ValidSystemDataKey, Set<(data: { value: unknown }) => void>>
> = {};
hass.mockWS(
"frontend/subscribe_system_data",
(_msg, currentHass, onChange) => {
onChange?.({
value: currentHass.systemData,
});
// eslint-disable-next-line @typescript-eslint/no-empty-function
return () => {};
({ key }: { key: ValidSystemDataKey }, _currentHass, onChange) => {
onChange?.({ value: systemData[key] ?? null });
if (!onChange) {
// eslint-disable-next-line @typescript-eslint/no-empty-function
return () => {};
}
const callbacks = (systemDataCallbacks[key] ??= new Set());
callbacks.add(onChange);
return () => {
callbacks.delete(onChange);
};
}
);
hass.mockWS(
"frontend/get_system_data",
({ key }: { key: ValidSystemDataKey }) => ({
value: systemData[key] ?? null,
})
);
hass.mockWS(
"frontend/set_system_data",
({ key, value }: { key: ValidSystemDataKey; value: unknown }) => {
systemData[key] = value;
systemDataCallbacks[key]?.forEach((callback) => callback({ value }));
}
);
hass.mockWS("labs/subscribe", (_msg, _currentHass, onChange) => {
@@ -77,7 +104,6 @@ export const mockFrontend = (hass: MockHomeAssistant) => {
// eslint-disable-next-line @typescript-eslint/no-empty-function
return () => {};
});
hass.mockWS("frontend/get_system_data", () => ({ value: null }));
hass.mockWS("repairs/list_issues", () => ({ issues: [] }));
hass.mockWS("frontend/get_themes", (_msg, currentHass) => currentHass.themes);
};
+33 -6
View File
@@ -351,6 +351,26 @@ const statisticsFunctions: Record<
const derivedCosts: Record<string, { source: string; price: number }> = {
"sensor.energy_water_cost": { source: "sensor.energy_water", price: 0.004 },
};
// Battery directions as a share of the meter the energy also passes, so they
// never exceed it
const derivedBatteryFlows: Record<string, { source: string; share: number }> = {
"sensor.powerwall_from_grid": {
source: "sensor.energy_consumption_tarif_1",
share: 0.4,
},
"sensor.powerwall_from_solar": {
source: "sensor.solar_production",
share: 0.3,
},
"sensor.powerwall_to_home": {
source: "sensor.energy_consumption_tarif_2",
share: 0.5,
},
"sensor.powerwall_to_grid": {
source: "sensor.energy_production_tarif_2",
share: 0.3,
},
};
export const mockRecorder = (mockHass: MockHomeAssistant) => {
mockHass.mockWS(
@@ -375,15 +395,22 @@ export const mockRecorder = (mockHass: MockHomeAssistant) => {
return cache[id];
};
const scaleStats = (source: string, factor: number) => {
let sum = 0;
return getStats(source).map((statistic) => {
const change = statistic.change! * factor;
sum += change;
return { ...statistic, change, state: sum, sum };
});
};
statistic_ids.forEach((id: string) => {
if (id in derivedCosts) {
const { source, price } = derivedCosts[id];
let cost = 0;
statistics[id] = getStats(source).map((statistic) => {
const change = statistic.change! * price;
cost += change;
return { ...statistic, change, state: cost, sum: cost };
});
statistics[id] = scaleStats(source, price);
} else if (id in derivedBatteryFlows) {
const { source, share } = derivedBatteryFlows[id];
statistics[id] = scaleStats(source, share);
} else if (id in statisticsFunctions) {
statistics[id] = getStats(id);
} else {
+217
View File
@@ -0,0 +1,217 @@
import { durationDataToSeconds } from "../../../src/common/datetime/duration_to_seconds";
import type {
TimerListMessage,
TimerListTimer,
} from "../../../src/data/timer_list";
import { timerListTimerRemaining } from "../../../src/data/timer_list";
import type { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
export interface MockTimerListTimer {
name?: string;
// Seconds
duration: number;
remaining?: number;
paused?: boolean;
finished?: boolean;
}
type ChangeEventType = Extract<
TimerListMessage,
{ type: "change" }
>["event_type"];
// Keeps the timers in memory, so the timer list actions work in demos.
// Returns a function that stops the mock.
export const mockTimerList = (
hass: MockHomeAssistant,
lists: Record<string, MockTimerListTimer[]>
) => {
let nextId = 0;
const listeners: Record<
string,
Set<(message: TimerListMessage) => void>
> = {};
const createTimer = (
duration: number,
name?: string,
remaining = duration,
paused = false
): TimerListTimer => ({
timer_id: `timer-${nextId++}`,
name: name ?? null,
status: paused ? "paused" : "active",
created_duration: duration,
total_duration: duration,
created_at: new Date().toISOString(),
finishes_at: paused
? null
: new Date(Date.now() + remaining * 1000).toISOString(),
paused_remaining: paused ? remaining : null,
ended_at: null,
remaining,
});
const timers: Record<string, TimerListTimer[]> = Object.fromEntries(
Object.entries(lists).map(([entityId, seeds]) => [
entityId,
seeds.map((seed) => {
const timer = createTimer(
seed.duration,
seed.name,
seed.remaining,
seed.paused
);
return seed.finished
? {
...timer,
status: "finished" as const,
finishes_at: null,
ended_at: timer.created_at,
remaining: 0,
}
: timer;
}),
])
);
const change = (
entityId: string,
timer: TimerListTimer,
eventType: ChangeEventType
) => {
timers[entityId] = (timers[entityId] ?? []).filter(
(item) => item.timer_id !== timer.timer_id
);
if (eventType !== "removed") {
timers[entityId].push(timer);
}
listeners[entityId]?.forEach((listener) =>
listener({ type: "change", event_type: eventType, timer })
);
hass.mockEntities[entityId].update({
state: String(
timers[entityId].filter((item) => item.status === "active").length
),
});
};
const end = (
entityId: string,
timer: TimerListTimer,
status: "finished" | "cancelled"
) =>
change(
entityId,
{
...timer,
status,
finishes_at: null,
paused_remaining: null,
ended_at: new Date().toISOString(),
remaining: 0,
},
status
);
const setRemaining = (
entityId: string,
timer: TimerListTimer,
remaining: number,
paused: boolean,
eventType: ChangeEventType
) =>
change(
entityId,
{
...timer,
status: paused ? "paused" : "active",
finishes_at: paused
? null
: new Date(Date.now() + remaining * 1000).toISOString(),
paused_remaining: paused ? remaining : null,
total_duration: Math.max(timer.total_duration, Math.ceil(remaining)),
remaining,
},
eventType
);
const mockTimerService = (
service: string,
handler: (
entityId: string,
timer: TimerListTimer,
data: Record<string, any>
) => void
) =>
hass.mockService("timer_list", service, (data, target) => {
const entityId: string = target!.entity_id;
const timer = timers[entityId].find(
(item) => item.timer_id === data!.timer_id
);
if (timer) {
handler(entityId, timer, data!);
}
});
hass.mockService("timer_list", "create_timer", (data, target) =>
change(
target!.entity_id,
createTimer(durationDataToSeconds(data!.duration), data!.name),
"created"
)
);
mockTimerService("pause_timer", (entityId, timer) =>
setRemaining(
entityId,
timer,
timerListTimerRemaining(timer),
true,
"paused"
)
);
mockTimerService("unpause_timer", (entityId, timer) =>
setRemaining(
entityId,
timer,
timerListTimerRemaining(timer),
false,
"unpaused"
)
);
mockTimerService("cancel_timer", (entityId, timer) =>
end(entityId, timer, "cancelled")
);
mockTimerService("remove_timer", (entityId, timer) =>
change(entityId, timer, "removed")
);
mockTimerService("add_time", (entityId, timer, data) =>
setRemaining(
entityId,
timer,
timerListTimerRemaining(timer) + durationDataToSeconds(data.duration),
timer.status === "paused",
"time_changed"
)
);
hass.mockWS("timer_list/item/subscribe", (msg, _hass, onChange) => {
const entityId: string = msg.entity_id;
listeners[entityId] ??= new Set();
listeners[entityId].add(onChange!);
onChange!({ type: "timers", timers: timers[entityId] ?? [] });
return () => listeners[entityId].delete(onChange!);
});
const interval = window.setInterval(() => {
for (const [entityId, items] of Object.entries(timers)) {
for (const timer of items) {
if (timer.status === "active" && !timerListTimerRemaining(timer)) {
end(entityId, timer, "finished");
}
}
}
}, 1000);
return () => window.clearInterval(interval);
};
+2 -1
View File
@@ -144,6 +144,7 @@ export default [
"iframe-card",
"markdown-card",
"todo-list-card",
"timer-list-card",
],
},
],
@@ -171,7 +172,7 @@ export default [
},
{
header: "Inputs and values",
pages: ["input-number", "input-text", "number", "timer"],
pages: ["input-number", "input-text", "number", "timer", "timer-list"],
},
{
header: "Time and schedules",
-1
View File
@@ -25,7 +25,6 @@ class DemoMoreInfo extends LitElement {
!computeShowNewMoreInfo(state)
? html`<state-card-content
.stateObj=${state}
.hass=${this.hass}
in-dialog
></state-card-content>`
: nothing
+19
View File
@@ -0,0 +1,19 @@
import type { ReactiveElement } from "lit";
import { ContextSubscriptionController } from "../../../src/common/decorators/consume";
import { uiContext } from "../../../src/data/context";
import type { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
// A demo that provides its own hass hides the gallery theme from its children,
// so pass the gallery light or dark mode on to it.
export const followGalleryTheme = (
host: ReactiveElement,
hass: MockHomeAssistant
) =>
new ContextSubscriptionController(host, uiContext, (ui) => {
if (ui) {
hass.updateHass({
themes: ui.themes,
selectedTheme: ui.selectedTheme,
});
}
});
+48
View File
@@ -0,0 +1,48 @@
import type { MockTimerListTimer } from "../../../demo/src/stubs/timer_list";
export const TIMER_LIST_ENTITIES = [
{
entity_id: "timer_list.kitchen",
state: "2",
attributes: {
friendly_name: "Kitchen timers",
supported_features: 63,
},
},
{
entity_id: "timer_list.empty",
state: "0",
attributes: {
friendly_name: "Empty timer list",
supported_features: 63,
},
},
{
entity_id: "timer_list.read_only",
state: "1",
attributes: {
friendly_name: "Read-only timers",
supported_features: 0,
},
},
{
entity_id: "timer_list.unavailable",
state: "unavailable",
attributes: {
friendly_name: "Unavailable timer list",
supported_features: 63,
},
},
];
export const TIMER_LIST_TIMERS: Record<string, MockTimerListTimer[]> = {
"timer_list.kitchen": [
{ name: "Eggs", duration: 360, finished: true },
{ name: "Pasta", duration: 600, remaining: 425 },
{ duration: 300, remaining: 40 },
{ name: "Bread", duration: 2700, remaining: 1310, paused: true },
],
"timer_list.read_only": [
{ name: "Laundry", duration: 5400, remaining: 3725 },
],
};
+1
View File
@@ -86,6 +86,7 @@ const mql = matchMedia("(prefers-color-scheme: dark)");
const galleryLocalize = (key: string) =>
(
({
"ui.common.loading": "Loading",
"ui.sidebar.sidebar_toggle": "Toggle sidebar",
"ui.notification_drawer.title": "Notifications",
"ui.sidebar.external_app_configuration": "App configuration",
@@ -284,7 +284,9 @@ export class DemoHaAdaptiveDialog extends LitElement {
<p>
The header title can be set using the <code>header-title</code>
attribute or by providing custom content in the
<code>headerTitle</code> slot.
<code>headerTitle</code> slot. When you use the slot, set the
<code>accessibleLabel</code> property so screen readers announce the
dialog's name.
</p>
<h4>Header subtitle</h4>
@@ -66,13 +66,14 @@ Check the [webawesome documentation](https://webawesome.com/docs/components/butt
**Properties/Attributes**
| Name | Type | Default | Description |
| ---------- | ---------------------------------------------- | -------- | --------------------------------------------------------------------------------- |
| appearance | "accent"/"filled"/"outlined"/"plain" | "accent" | Sets the button appearance. |
| variants | "brand"/"danger"/"neutral"/"warning"/"success" | "brand" | Sets the button color variant. "brand" is default. |
| size | "xs"/"s"/"m"/"l"/"xl" | "m" | Sets the button size. |
| loading | Boolean | false | Shows a loading indicator instead of the buttons label and disable buttons click. |
| disabled | Boolean | false | Disables the button and prevents user interaction. |
| Name | Type | Default | Description |
| ------------ | ---------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------- |
| appearance | "accent"/"filled"/"outlined"/"plain" | "accent" | Sets the button appearance. |
| variants | "brand"/"danger"/"neutral"/"warning"/"success" | "brand" | Sets the button color variant. "brand" is default. |
| size | "xs"/"s"/"m"/"l"/"xl" | "m" | Sets the button size. |
| loading | Boolean | false | Shows a loading indicator instead of the buttons label and disable buttons click. |
| disabled | Boolean | false | Disables the button and prevents user interaction. |
| aria-pressed | "true"/"false" | - | Makes it a toggle button and tells screen readers whether it is pressed. Leave unset for a regular button. |
**CSS Custom Properties**
@@ -29,8 +29,8 @@ This component is based on the webawesome input component.
**Slots**
- `start`: Content placed before the input (usually for icons or prefixes).
- `end`: Content placed after the input (usually for icons or suffixes).
- `start`: Content placed before the input, usually an icon. Use `input-prefix` for text.
- `end`: Content placed after the input, usually an icon. Use `input-suffix` for text.
- `label`: Custom label content. Overrides the `label` property.
- `hint`: Custom hint content. Overrides the `hint` property.
- `clear-icon`: Custom clear icon.
@@ -56,6 +56,8 @@ This component is based on the webawesome input component.
| auto-validate | Boolean | false | Validates the input on blur instead of on form submit. |
| invalid | Boolean | false | Marks the input as invalid. |
| inset-label | Boolean | false | Uses an inset label style where the label stays inside the input. |
| input-prefix | String | - | Fixed text shown before the value. With a label, the label is inset above the prefix. |
| input-suffix | String | - | Fixed text shown after the value. |
| validation-message | String | "" | Custom validation message shown when the input is invalid. |
| input-id | String | - | Sets the native input's `id` and associated label `for` on the inner `wa-input`. Defaults to `"input"`. |
| pattern | String | - | A regular expression pattern to validate input against. |
+7 -7
View File
@@ -136,14 +136,14 @@ export class DemoHaInput extends LitElement {
></ha-input>
</div>
<h3>With slots</h3>
<h3>Prefix, suffix and slots</h3>
<div class="row">
<ha-input label="With prefix">
<span slot="start">$</span>
</ha-input>
<ha-input label="With suffix">
<span slot="end">kg</span>
</ha-input>
<ha-input
label="With prefix"
input-prefix="update."
value="living_room"
></ha-input>
<ha-input label="With suffix" input-suffix="kg"></ha-input>
<ha-input label="With icon">
<ha-svg-icon
.path=${mdiMagnify}
+72 -5
View File
@@ -117,11 +117,17 @@ shared slots/attributes below.
**Attributes**
| Name | Type | Default | Description |
| ----------------- | ------- | ------- | --------------------------------------- |
| `headline` | String | — | Primary text. Overridden by the slot. |
| `supporting-text` | String | — | Secondary text. Overridden by the slot. |
| `disabled` | Boolean | `false` | Dims the row and blocks pointer events. |
| Name | Type | Default | Description |
| ---------------------- | ------- | ------- | -------------------------------------------------- |
| `headline` | String | — | Primary text. Overridden by the slot. |
| `supporting-text` | String | — | Secondary text. Overridden by the slot. |
| `wrap-headline` | Boolean | `false` | Wrap the headline instead of truncating it. |
| `wrap-supporting-text` | Boolean | `false` | Wrap the supporting text instead of truncating it. |
| `disabled` | Boolean | `false` | Dims the row and blocks pointer events. |
The headline and the supporting text stay on one line and are truncated with an
ellipsis by default. Set `wrap-headline` or `wrap-supporting-text` on rows whose
text has to stay readable in full, like settings with a description.
**CSS parts**
@@ -165,6 +171,18 @@ Interactive row. Renders an inner `<a>` when `href` is set, otherwise a
roving tabindex, the host is the tab stop and the inner element carries
`tabindex="-1"`.
Only the headline and supporting text are inside the `<a>` or `<button>`; its
hit area is stretched over the whole row. The `start` and `end` slots sit next
to it, so controls placed there, like an `ha-icon-button` or `ha-dropdown`,
stay separate controls for screen readers. Slotted elements are raised above
the hit area so they can be clicked, except icons, badges, `span`s and empty
`div`s (dividers), which let clicks and hover through to the row. A focusable
element (with `tabindex`) is always raised. To keep another element clickable
on its own, like a drag handle, give it `z-index: 1` in the consumer's styles.
Subclasses customize the row by overriding `_renderStart()`,
`_renderContent()` and `_renderEnd()`. `_renderInner()` is not used.
**Attributes**
- `href` (String) — when set, renders an `<a>` instead of a `<button>`.
@@ -174,8 +192,54 @@ roving tabindex, the host is the tab stop and the inner element carries
**CSS parts**
- `control` — the inner `<a>` or `<button>`.
- `ripple` — the ripple effect element.
### `<ha-list-item-switch>`
Row with a switch at the end, for settings that turn something on or off. The
whole row is the label of the switch: clicking anywhere on it toggles the
switch. For screen readers, the headline names the switch and the supporting
text describes it, so don't set `accessibleLabel` yourself.
The switch is its own tab stop, so the row doesn't join the roving tabindex of
a parent list. The row can also be used on its own, outside a list; it then has
no role.
Everything in the row is part of the label, so there is no `end` slot, and
the `start` slot is for icons and avatars only. For a row with other controls
next to the switch or inside its text, like an `ha-icon-button` or a link, use
`ha-list-item-base` with an `ha-switch` in the `end` slot and set its
`accessibleLabel`.
The row inherits the slots and attributes of `ha-list-item-base`, except
`interactive`, which it doesn't use.
```html
<ha-list-item-switch checked>
<span slot="headline">Advanced mode</span>
<span slot="supporting-text">Shows advanced settings and options.</span>
</ha-list-item-switch>
```
**Attributes**
- `checked` (Boolean, default `false`, reflected) — whether the switch is on.
- `haptic` (Boolean, default `false`) — vibrates on toggle. Only set it when
the change is applied right away, not when the user still has to save.
**Events**
- `change` — the switch was toggled. Read the new state from `checked` on the
row.
**CSS parts**
- `switch` — the `ha-switch`. It only shows the state; the row handles
input.
- `base`, `start`, `content`, `headline`, `supporting-text` — as on
`ha-row-item`. There is no `end` part.
### `<ha-list-item-option>`
Selectable row. Host role is `option`; reflects `aria-selected`. Designed to
@@ -186,6 +250,9 @@ sit inside `<ha-list-selectable>`, which owns selection state and toggles
- `selected` (Boolean, default `false`, reflected) — set by the parent
`ha-list-selectable`.
- `indeterminate` (Boolean, default `false`, reflected) — draws the checkbox
as mixed, for a row that stands for a partly selected set. Screen readers
hear it as "Partly selected" through `aria-description`.
- `value` (String) — value identifying the option.
- `appearance` (`"line"` | `"checkbox"`, default `"line"`) — `"line"`
highlights the row; `"checkbox"` renders a decorative `<ha-checkbox>`.
+146
View File
@@ -2,21 +2,28 @@ import {
mdiAccount,
mdiChevronRight,
mdiCog,
mdiDelete,
mdiHome,
mdiInformationOutline,
mdiMapMarker,
mdiOpenInNew,
mdiPencil,
mdiViewDashboard,
mdiWifi,
} from "@mdi/js";
import type { TemplateResult } from "lit";
import { css, html, LitElement } from "lit";
import { customElement, state } from "lit/decorators";
import type { HASSDomTargetEvent } from "../../../../src/common/dom/fire_event";
import "../../../../src/components/ha-card";
import "../../../../src/components/ha-icon-button";
import "../../../../src/components/ha-icon-next";
import "../../../../src/components/ha-svg-icon";
import "../../../../src/components/item/ha-list-item-base";
import "../../../../src/components/item/ha-list-item-button";
import "../../../../src/components/item/ha-list-item-option";
import "../../../../src/components/item/ha-list-item-switch";
import type { HaListItemSwitch } from "../../../../src/components/item/ha-list-item-switch";
import "../../../../src/components/list/ha-list-base";
import "../../../../src/components/list/ha-list-nav";
import "../../../../src/components/list/ha-list-selectable";
@@ -77,6 +84,8 @@ const treeKey = (group: TreeGroup, child: TreeChild) =>
export class DemoHaList extends LitElement {
@state() private _buttonClicks = 0;
@state() private _lastAction = "none";
@state() private _single: number | Set<number> = -1;
@state() private _multiLine: number | Set<number> = new Set();
@@ -87,6 +96,12 @@ export class DemoHaList extends LitElement {
@state() private _tree = new Set<string>();
@state() private _switches: Record<string, boolean> = {
wifi: true,
advanced: false,
standalone: false,
};
private _options = ["Alpha", "Beta", "Gamma", "Delta", "Epsilon"];
protected render(): TemplateResult {
@@ -185,6 +200,20 @@ export class DemoHaList extends LitElement {
<ha-list-item-base headline="Disabled row" disabled>
<ha-svg-icon slot="start" .path=${mdiHome}></ha-svg-icon>
</ha-list-item-base>
<ha-list-item-base
headline="Truncated by default, a long headline stays on one line and ends with an ellipsis"
supporting-text="Long supporting text is truncated as well, so every row in the list keeps the same height"
>
<ha-svg-icon slot="start" .path=${mdiHome}></ha-svg-icon>
</ha-list-item-base>
<ha-list-item-base
wrap-headline
wrap-supporting-text
headline="With wrap-headline, a long headline wraps onto as many lines as it needs"
supporting-text="With wrap-supporting-text, long supporting text wraps too, which suits settings with a description"
>
<ha-svg-icon slot="start" .path=${mdiHome}></ha-svg-icon>
</ha-list-item-base>
</ha-list-base>
</ha-card>
@@ -220,6 +249,101 @@ export class DemoHaList extends LitElement {
</ha-list-base>
</ha-card>
<ha-card header="Row with actions in the end slot">
<p class="card-text">
Last action: <code>${this._lastAction}</code>. The action buttons are
separate controls; icons and the divider activate the row.
</p>
<ha-list-base aria-label="Rows with actions">
<ha-list-item-button data-action="row" @click=${this._onActionClick}>
<ha-svg-icon slot="start" .path=${mdiHome}></ha-svg-icon>
<span slot="headline">Button row</span>
<span slot="supporting-text">Click the row or an action</span>
<ha-icon-next slot="end"></ha-icon-next>
<div slot="end" class="vertical-divider"></div>
<ha-icon-button
slot="end"
data-action="edit"
.path=${mdiPencil}
label="Edit"
@click=${this._onActionClick}
></ha-icon-button>
<ha-icon-button
slot="end"
data-action="delete"
.path=${mdiDelete}
label="Delete"
@click=${this._onActionClick}
></ha-icon-button>
</ha-list-item-button>
<ha-list-item-button href="#components/ha-list">
<ha-svg-icon slot="start" .path=${mdiMapMarker}></ha-svg-icon>
<span slot="headline">Link row</span>
<span slot="supporting-text"
>Cmd/Ctrl-click on the icon or chevron opens a new tab</span
>
<ha-icon-button
slot="end"
data-action="link-edit"
.path=${mdiPencil}
label="Edit"
@click=${this._onActionClick}
></ha-icon-button>
<ha-icon-next slot="end"></ha-icon-next>
</ha-list-item-button>
</ha-list-base>
</ha-card>
<h2>ha-list-item-switch</h2>
<p>
Row with a switch. The whole row is the label of the switch, so clicking
anywhere on it toggles the switch.
</p>
<ha-card header="In a list">
<ha-list-base aria-label="Switch items">
<ha-list-item-switch
wrap-supporting-text
.checked=${this._switches.wifi}
data-switch="wifi"
@change=${this._onSwitchChange}
>
<ha-svg-icon slot="start" .path=${mdiWifi}></ha-svg-icon>
<span slot="headline">Wi-Fi</span>
<span slot="supporting-text"
>Connect to known networks automatically.</span
>
</ha-list-item-switch>
<ha-list-item-switch
.checked=${this._switches.advanced}
data-switch="advanced"
@change=${this._onSwitchChange}
>
<span slot="headline">Advanced mode</span>
</ha-list-item-switch>
<ha-list-item-switch
disabled
checked
headline="Disabled"
supporting-text="Can't be changed"
></ha-list-item-switch>
</ha-list-base>
</ha-card>
<ha-card header="Without a list">
<ha-list-item-switch
wrap-headline
.checked=${this._switches.standalone}
data-switch="standalone"
@change=${this._onSwitchChange}
>
<span slot="headline">A row on its own, without a list role</span>
</ha-list-item-switch>
<p class="card-text">
State: <code>${JSON.stringify(this._switches)}</code>
</p>
</ha-card>
<h2>ha-list-selectable + ha-list-item-option</h2>
<p>
Selectable list (<code>role="listbox"</code>). Items must be
@@ -428,10 +552,23 @@ selected: ${JSON.stringify(this._toJson(this._multiCheckEnd))}</pre>
return value instanceof Set ? [...value] : value;
}
private _onActionClick = (ev: MouseEvent) => {
ev.stopPropagation();
this._lastAction =
(ev.currentTarget as HTMLElement).dataset.action ?? "none";
};
private _onButtonClick = () => {
this._buttonClicks++;
};
private _onSwitchChange = (ev: HASSDomTargetEvent<HaListItemSwitch>) => {
this._switches = {
...this._switches,
[ev.target.dataset.switch!]: ev.target.checked,
};
};
private _withIndex(
value: number | Set<number>,
index: number,
@@ -542,6 +679,15 @@ selected: ${JSON.stringify(this._toJson(this._multiCheckEnd))}</pre>
ha-card {
max-width: 560px;
}
.card-text {
margin: 0;
padding: 0 var(--ha-space-4) var(--ha-space-2);
}
.vertical-divider {
align-self: stretch;
width: 1px;
background: var(--divider-color);
}
pre {
padding: var(--ha-space-4);
background: var(--secondary-background-color);
+2 -2
View File
@@ -924,7 +924,7 @@ class DemoHaSelector extends LitElement implements ProvideHassElement {
providers: [
{
engine_id: "stt.cloud",
name: "Home Assistant Cloud",
name: "Home Assistant Link",
supported_languages: ["en-US"],
deprecated: false,
},
@@ -934,7 +934,7 @@ class DemoHaSelector extends LitElement implements ProvideHassElement {
providers: [
{
engine_id: "tts.cloud",
name: "Home Assistant Cloud",
name: "Home Assistant Link",
supported_languages: ["en-US"],
deprecated: false,
},
@@ -2,3 +2,17 @@
title: Spinner
subtitle: Can be used to indicate an ongoing task.
---
`ha-spinner` is `hac-spinner` from `@home-assistant/components`.
## Accessibility
`ha-spinner` is exposed to screen readers as a `progressbar` named with the translated "Loading". When the surrounding text does not already say what is in progress, name it with a translated `accessible-label`, like "Installing update", rather than its state.
```html
<ha-spinner accessible-label="Installing update"></ha-spinner>
```
If the spinner only decorates text that already says what is in progress, hide it with `aria-hidden="true"`.
For an action started from a button, use `ha-button` with `loading` instead of putting a spinner inside the button.
+4 -2
View File
@@ -23,8 +23,10 @@ export class DemoHaSpinner extends LitElement {
<ha-spinner size="small"></ha-spinner>
<ha-spinner size="medium"></ha-spinner>
<ha-spinner size="large"></ha-spinner>
<ha-spinner aria-label="Doing something..."></ha-spinner>
<ha-spinner .ariaLabel=${"Doing something..."}></ha-spinner>
<ha-spinner accessible-label="Doing something..."></ha-spinner>
<ha-spinner
.accessibleLabel=${"Doing something..."}
></ha-spinner>
</div>
</ha-card>
`
@@ -10,6 +10,7 @@ import type {
} from "../../../../src/data/history";
import { provideHass } from "../../../../src/fake_data/provide_hass";
import type { HomeAssistant } from "../../../../src/types";
import { followGalleryTheme } from "../../data/follow-gallery-theme";
const HOUR = 60 * 60 * 1000;
const HOURS = 48;
@@ -166,6 +167,7 @@ export class DemoStateHistoryCharts extends LitElement {
super.firstUpdated(changedProps);
const hass = provideHass(this);
hass.updateTranslations(null, "en");
followGalleryTheme(this, hass);
hass.addEntities(ENTITIES);
}
@@ -1,7 +1,9 @@
import type { PropertyValues } from "lit";
import { css, html, LitElement, nothing } from "lit";
import { customElement, property } from "lit/decorators";
import { customElement, property, state } from "lit/decorators";
import type { ChartSelectMode } from "../../../../src/components/chart/ha-chart-base";
import "../../../../src/components/chart/statistics-chart";
import "../../../../src/components/ha-button";
import "../../../../src/components/ha-card";
import type {
Statistics,
@@ -11,7 +13,9 @@ import type {
} from "../../../../src/data/recorder";
import { StatisticMeanType } from "../../../../src/data/recorder";
import { provideHass } from "../../../../src/fake_data/provide_hass";
import type { HASSDomEvent } from "../../../../src/common/dom/fire_event";
import type { HomeAssistant } from "../../../../src/types";
import { followGalleryTheme } from "../../data/follow-gallery-theme";
const HOUR = 60 * 60 * 1000;
const HOURS = 48;
@@ -108,6 +112,64 @@ interface Example {
height?: string;
}
interface TimeRange {
start: number;
end: number;
}
interface RangeExample {
id: string;
title: string;
description: string;
statistics: Statistics;
statTypes: StatisticType[];
chartType: "line" | "bar";
unit: string;
selectMode: ChartSelectMode;
hint: string;
}
const RANGE_EXAMPLES: RangeExample[] = [
{
id: "point",
title: "Point selection",
description:
"With select-mode set to point, a click selects the hour that contains it, and everything outside fades. Dragging still zooms.",
statistics: { [HEAT_PUMP_ID]: HEAT_PUMP },
statTypes: ["change"],
chartType: "bar",
unit: "kWh",
selectMode: "point",
hint: "Click on a bar to select its hour.",
},
{
id: "range-bar",
title: "Range selection on bars",
description:
"With select-mode set to range, dragging selects a time range instead of zooming, so several bars can be selected at once. A click still selects one bar.",
statistics: { [HEAT_PUMP_ID]: HEAT_PUMP },
statTypes: ["change"],
chartType: "bar",
unit: "kWh",
selectMode: "range",
hint: "Click or drag on the chart to select one or more bars.",
},
{
id: "range",
title: "Range selection on lines",
description: "The same on a line chart.",
statistics: { [LIVING_ROOM_ID]: LIVING_ROOM },
statTypes: ["mean", "min", "max"],
chartType: "line",
unit: "°C",
selectMode: "range",
hint: "Click or drag on the chart to select a period.",
},
];
const formatRange = (range: TimeRange) =>
`${new Date(range.start).toLocaleString()} to ${new Date(range.end).toLocaleString()}`;
const EXAMPLES: Example[] = [
{
title: "Sum as bars",
@@ -159,17 +221,20 @@ const EXAMPLES: Example[] = [
export class DemoStatisticsChart extends LitElement {
@property({ attribute: false }) public hass?: HomeAssistant;
@state() private _selections: Record<string, TimeRange | undefined> = {};
protected firstUpdated(changedProps: PropertyValues<this>) {
super.firstUpdated(changedProps);
const hass = provideHass(this);
hass.updateTranslations(null, "en");
followGalleryTheme(this, hass);
}
protected render() {
if (!this.hass) {
return nothing;
}
return EXAMPLES.map(
return html`${EXAMPLES.map(
(example) => html`
<ha-card header=${example.title}>
<div class="card-content">
@@ -191,7 +256,66 @@ export class DemoStatisticsChart extends LitElement {
</div>
</ha-card>
`
);
)}
${RANGE_EXAMPLES.map((example) => this._renderRangeExample(example))}`;
}
private _renderRangeExample(example: RangeExample) {
const selection = this._selections[example.id];
return html`
<ha-card header=${example.title}>
<div class="card-content">
<p>${example.description}</p>
<statistics-chart
.statisticsData=${example.statistics}
.metadata=${METADATA}
.names=${NAMES}
.statTypes=${example.statTypes}
.chartType=${example.chartType}
period="hour"
.unit=${example.unit}
.startTime=${START}
.endTime=${END}
.highlight=${selection}
.clickForMoreInfo=${false}
data-example=${example.id}
.selectMode=${example.selectMode}
hide-legend
@chart-select=${this._rangeSelected}
></statistics-chart>
<div class="selection">
${
selection
? html`
<span>${formatRange(selection)}</span>
<ha-button
appearance="plain"
size="s"
data-example=${example.id}
@click=${this._clearSelection}
>
Clear
</ha-button>
`
: html`<span class="hint">${example.hint}</span>`
}
</div>
</div>
</ha-card>
`;
}
private _rangeSelected(ev: HASSDomEvent<HASSDomEvents["chart-select"]>) {
const id = (ev.currentTarget as HTMLElement).dataset.example!;
this._selections = {
...this._selections,
[id]: ev.detail,
};
}
private _clearSelection(ev: Event) {
const id = (ev.currentTarget as HTMLElement).dataset.example!;
this._selections = { ...this._selections, [id]: undefined };
}
static styles = css`
@@ -202,6 +326,20 @@ export class DemoStatisticsChart extends LitElement {
p {
margin-top: 0;
}
.selection {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--ha-space-2);
min-height: 48px;
margin-top: var(--ha-space-2);
padding: 0 var(--ha-space-2) 0 var(--ha-space-4);
border-radius: var(--ha-border-radius-lg);
background-color: var(--secondary-background-color);
}
.hint {
color: var(--secondary-text-color);
}
`;
}
@@ -0,0 +1,3 @@
---
title: Timer list card
---
@@ -0,0 +1,117 @@
import type { PropertyValues, TemplateResult } from "lit";
import { html, LitElement, nothing } from "lit";
import { customElement, property } from "lit/decorators";
import type { HASSDomEvent } from "../../../../src/common/dom/fire_event";
import type { ShowDialogParams } from "../../../../src/dialogs/make-dialog-manager";
import { showDialog } from "../../../../src/dialogs/make-dialog-manager";
import { mockIcons } from "../../../../demo/src/stubs/icons";
import { mockTimerList } from "../../../../demo/src/stubs/timer_list";
import type { MockHomeAssistant } from "../../../../src/fake_data/provide_hass";
import { provideHass } from "../../../../src/fake_data/provide_hass";
import type { TimerListCardConfig } from "../../../../src/panels/lovelace/cards/types";
import type { DemoCardConfig } from "../../components/demo-card";
import "../../components/demo-cards";
import { TIMER_LIST_ENTITIES, TIMER_LIST_TIMERS } from "../../data/timer_list";
const CONFIGS = [
{
heading: "Timers",
config: {
type: "timer-list",
entity: "timer_list.kitchen",
},
},
{
heading: "With title, without the add timer button",
config: {
type: "timer-list",
title: "Kitchen",
entity: "timer_list.kitchen",
hide_create: true,
},
},
{
heading: "No timers",
config: {
type: "timer-list",
entity: "timer_list.empty",
},
},
{
heading: "No supported actions",
config: {
type: "timer-list",
entity: "timer_list.read_only",
},
},
{
heading: "Unavailable",
config: {
type: "timer-list",
entity: "timer_list.unavailable",
},
},
] satisfies DemoCardConfig<TimerListCardConfig>[];
@customElement("demo-lovelace-timer-list-card")
class DemoTimerListCard extends LitElement {
@property({ attribute: false }) public hass?: MockHomeAssistant;
private _stopTimerList?: () => void;
public provideHass(el) {
el.hass = this.hass;
}
public connectedCallback() {
super.connectedCallback();
this.addEventListener("show-dialog", this._dialogManager);
}
public disconnectedCallback() {
super.disconnectedCallback();
this.removeEventListener("show-dialog", this._dialogManager);
this._stopTimerList?.();
}
// Opens the dialog to start a timer
private _dialogManager = (e: HASSDomEvent<ShowDialogParams<unknown>>) => {
const { dialogTag, dialogImport, dialogParams, addHistory, parentElement } =
e.detail;
showDialog(
this,
dialogTag,
dialogParams,
dialogImport,
parentElement,
addHistory
);
};
protected render(): TemplateResult | typeof nothing {
if (!this.hass) {
return nothing;
}
return html`<demo-cards
.hass=${this.hass}
.configs=${CONFIGS}
></demo-cards>`;
}
protected firstUpdated(changedProperties: PropertyValues<this>) {
super.firstUpdated(changedProperties);
// Provided on this element, so the dialog it opens gets the mocks too
const hass = provideHass(this);
hass.updateTranslations(null, "en");
hass.updateTranslations("lovelace", "en");
hass.addEntities(TIMER_LIST_ENTITIES);
mockIcons(hass);
this._stopTimerList = mockTimerList(hass, TIMER_LIST_TIMERS);
}
}
declare global {
interface HTMLElementTagNameMap {
"demo-lovelace-timer-list-card": DemoTimerListCard;
}
}
@@ -1,8 +1,8 @@
---
title: Cloud account
title: Home Assistant Link account
---
The [Home Assistant Cloud](https://www.nabucasa.com/) account page, rendered from
mocked cloud data. The controls at the top flip the mocked subscription, remote,
The [Home Assistant Link](https://www.nabucasa.com/) account page, rendered from
mocked Home Assistant Link data. The controls at the top flip the mocked subscription, remote,
backup, onboarding, and feature state so every UI state can be previewed here
without a real cloud account.
without a real Home Assistant Link account.
+133
View File
@@ -187,6 +187,139 @@ const ENTITIES = [
current_tilt_position: 70,
},
},
{
entity_id: "cover.shade",
state: "open",
attributes: {
friendly_name: "Shade",
device_class: "shade",
supported_features:
CoverEntityFeature.OPEN +
CoverEntityFeature.STOP +
CoverEntityFeature.CLOSE +
CoverEntityFeature.SET_POSITION,
current_position: 60,
},
},
{
entity_id: "cover.shutter",
state: "open",
attributes: {
friendly_name: "Shutter",
device_class: "shutter",
supported_features:
CoverEntityFeature.OPEN +
CoverEntityFeature.STOP +
CoverEntityFeature.CLOSE +
CoverEntityFeature.SET_POSITION,
current_position: 40,
},
},
{
entity_id: "cover.awning",
state: "open",
attributes: {
friendly_name: "Awning",
device_class: "awning",
supported_features:
CoverEntityFeature.OPEN +
CoverEntityFeature.STOP +
CoverEntityFeature.CLOSE +
CoverEntityFeature.SET_POSITION,
current_position: 70,
},
},
{
entity_id: "cover.curtain",
state: "open",
attributes: {
friendly_name: "Curtain",
device_class: "curtain",
supported_features:
CoverEntityFeature.OPEN +
CoverEntityFeature.STOP +
CoverEntityFeature.CLOSE +
CoverEntityFeature.SET_POSITION,
current_position: 50,
},
},
{
entity_id: "cover.door",
state: "open",
attributes: {
friendly_name: "Door",
device_class: "door",
supported_features:
CoverEntityFeature.OPEN +
CoverEntityFeature.STOP +
CoverEntityFeature.CLOSE +
CoverEntityFeature.SET_POSITION,
current_position: 30,
},
},
{
entity_id: "cover.gate",
state: "open",
attributes: {
friendly_name: "Gate",
device_class: "gate",
supported_features:
CoverEntityFeature.OPEN +
CoverEntityFeature.STOP +
CoverEntityFeature.CLOSE +
CoverEntityFeature.SET_POSITION,
current_position: 30,
},
},
{
entity_id: "cover.window",
state: "open",
attributes: {
friendly_name: "Window",
device_class: "window",
supported_features:
CoverEntityFeature.OPEN +
CoverEntityFeature.STOP +
CoverEntityFeature.CLOSE +
CoverEntityFeature.SET_POSITION,
current_position: 50,
},
},
{
entity_id: "cover.garage",
state: "closed",
attributes: {
friendly_name: "Garage door",
device_class: "garage",
supported_features: CoverEntityFeature.OPEN + CoverEntityFeature.CLOSE,
},
},
{
entity_id: "cover.unknown",
state: "unknown",
attributes: {
friendly_name: "Unknown position",
device_class: "shade",
supported_features:
CoverEntityFeature.OPEN +
CoverEntityFeature.STOP +
CoverEntityFeature.CLOSE +
CoverEntityFeature.SET_POSITION,
},
},
{
entity_id: "cover.unavailable",
state: "unavailable",
attributes: {
friendly_name: "Unavailable",
device_class: "shutter",
supported_features:
CoverEntityFeature.OPEN +
CoverEntityFeature.STOP +
CoverEntityFeature.CLOSE +
CoverEntityFeature.SET_POSITION,
},
},
];
@customElement("demo-more-info-cover")
@@ -0,0 +1,3 @@
---
title: Timer list
---
+76
View File
@@ -0,0 +1,76 @@
import type { PropertyValues, TemplateResult } from "lit";
import { html, LitElement, nothing } from "lit";
import { customElement, property } from "lit/decorators";
import type { HASSDomEvent } from "../../../../src/common/dom/fire_event";
import type { ShowDialogParams } from "../../../../src/dialogs/make-dialog-manager";
import { showDialog } from "../../../../src/dialogs/make-dialog-manager";
import { mockTimerList } from "../../../../demo/src/stubs/timer_list";
import "../../../../src/components/ha-card";
import "../../../../src/dialogs/more-info/more-info-content";
import type { MockHomeAssistant } from "../../../../src/fake_data/provide_hass";
import { provideHass } from "../../../../src/fake_data/provide_hass";
import "../../components/demo-more-infos";
import { TIMER_LIST_ENTITIES, TIMER_LIST_TIMERS } from "../../data/timer_list";
@customElement("demo-more-info-timer-list")
class DemoMoreInfoTimerList extends LitElement {
@property({ attribute: false }) public hass!: MockHomeAssistant;
private _stopTimerList?: () => void;
public provideHass(el) {
el.hass = this.hass;
}
public connectedCallback() {
super.connectedCallback();
this.addEventListener("show-dialog", this._dialogManager);
}
public disconnectedCallback() {
super.disconnectedCallback();
this.removeEventListener("show-dialog", this._dialogManager);
this._stopTimerList?.();
}
// Opens the dialog to start a timer
private _dialogManager = (e: HASSDomEvent<ShowDialogParams<unknown>>) => {
const { dialogTag, dialogImport, dialogParams, addHistory, parentElement } =
e.detail;
showDialog(
this,
dialogTag,
dialogParams,
dialogImport,
parentElement,
addHistory
);
};
protected render(): TemplateResult | typeof nothing {
if (!this.hass) {
return nothing;
}
return html`
<demo-more-infos
.hass=${this.hass}
.entities=${TIMER_LIST_ENTITIES.map((ent) => ent.entity_id)}
></demo-more-infos>
`;
}
protected firstUpdated(changedProperties: PropertyValues<this>) {
super.firstUpdated(changedProperties);
// Provided on this element, so the dialog it opens gets the mocks too
const hass = provideHass(this);
hass.updateTranslations(null, "en");
hass.addEntities(TIMER_LIST_ENTITIES);
this._stopTimerList = mockTimerList(hass, TIMER_LIST_TIMERS);
}
}
declare global {
interface HTMLElementTagNameMap {
"demo-more-info-timer-list": DemoMoreInfoTimerList;
}
}
+11 -2
View File
@@ -250,7 +250,16 @@ class DemoMoreInfoUpdate extends LitElement {
"update/release_notes",
(msg: { type: string; entity_id: string }) => {
if (msg.entity_id === "update.update16") {
return LONG_TEXT;
return {
release_notes: LONG_TEXT,
messages: [
{
severity: "warning",
message:
"Do not restart, remove power from, or otherwise interrupt the device while the update is in progress.",
},
],
};
}
if (msg.entity_id === "update.update17") {
return Promise.reject({
@@ -261,7 +270,7 @@ class DemoMoreInfoUpdate extends LitElement {
if (msg.entity_id === "update.update18") {
return undefined;
}
return null;
return { release_notes: null, messages: [] };
}
);
}
+44 -44
View File
@@ -40,7 +40,7 @@
"license": "Apache-2.0",
"type": "module",
"dependencies": {
"@babel/runtime": "8.1.0",
"@babel/runtime": "8.1.3",
"@braintree/sanitize-url": "7.1.2",
"@codemirror/autocomplete": "6.20.4",
"@codemirror/commands": "6.11.1",
@@ -48,23 +48,23 @@
"@codemirror/lang-python": "6.2.1",
"@codemirror/lang-yaml": "6.1.3",
"@codemirror/language": "6.13.1",
"@codemirror/lint": "6.9.7",
"@codemirror/lint": "6.9.8",
"@codemirror/search": "6.7.2",
"@codemirror/state": "6.7.6",
"@codemirror/view": "6.43.15",
"@date-fns/tz": "1.5.0",
"@egjs/hammerjs": "2.0.17",
"@formatjs/intl-datetimeformat": "8.0.2",
"@formatjs/intl-displaynames": "8.0.1",
"@formatjs/intl-durationformat": "0.12.3",
"@formatjs/intl-getcanonicallocales": "3.3.0",
"@formatjs/intl-listformat": "9.0.1",
"@formatjs/intl-locale": "5.4.2",
"@formatjs/intl-numberformat": "10.0.2",
"@formatjs/intl-pluralrules": "7.0.2",
"@formatjs/intl-relativetimeformat": "13.0.1",
"@formatjs/intl-datetimeformat": "8.0.3",
"@formatjs/intl-displaynames": "8.0.3",
"@formatjs/intl-durationformat": "0.13.0",
"@formatjs/intl-getcanonicallocales": "3.4.0",
"@formatjs/intl-listformat": "9.1.0",
"@formatjs/intl-locale": "5.5.0",
"@formatjs/intl-numberformat": "10.1.0",
"@formatjs/intl-pluralrules": "7.1.0",
"@formatjs/intl-relativetimeformat": "13.0.3",
"@home-assistant/webawesome": "3.14.0-ha.2",
"@lezer/common": "1.5.5",
"@lezer/common": "1.5.6",
"@lezer/highlight": "1.2.5",
"@lit-labs/motion": "1.1.0",
"@lit-labs/observers": "2.1.0",
@@ -77,18 +77,18 @@
"@mdi/svg": "7.4.47",
"@replit/codemirror-indentation-markers": "6.5.3",
"@swc/helpers": "0.5.24",
"@tsparticles/engine": "4.5.2",
"@tsparticles/preset-links": "4.5.2",
"@versatiles/style": "8.1.1",
"@tsparticles/engine": "4.5.4",
"@tsparticles/preset-links": "4.5.4",
"@versatiles/style": "9.1.0",
"@vibrant/color": "4.0.4",
"@vvo/tzdb": "6.202.0",
"@webcomponents/scoped-custom-element-registry": "0.0.10",
"barcode-detector": "3.2.3",
"@vvo/tzdb": "6.204.0",
"@webcomponents/scoped-custom-element-registry": "0.0.11",
"barcode-detector": "3.2.4",
"cally": "0.9.2",
"color-name": "2.1.1",
"comlink": "4.4.2",
"core-js": "3.51.0",
"cropperjs": "1.7.0",
"cropperjs": "2.3.1",
"culori": "4.0.2",
"date-fns": "4.4.0",
"decimal.js": "10.6.0",
@@ -97,19 +97,19 @@
"echarts": "6.1.0",
"echarts-extension-chart2music": "0.1.1",
"element-internals-polyfill": "3.0.2",
"fullcalendar": "7.1.4",
"fullcalendar": "7.1.5",
"fuse.js": "7.5.0",
"hls.js": "1.7.4",
"home-assistant-js-websocket": "9.8.1",
"home-assistant-js-websocket": "9.9.0",
"idb-keyval": "6.3.0",
"intl-messageformat": "12.1.4",
"intl-messageformat": "12.2.0",
"js-yaml": "5.5.0",
"leaflet": "1.9.4",
"leaflet.markercluster": "1.5.3",
"lit": "3.3.3",
"lit-html": "3.3.3",
"maplibre-gl": "6.16.0",
"marked": "18.1.3",
"maplibre-gl": "6.19.0",
"marked": "18.2.1",
"memoize-one": "6.0.0",
"nanoid": "6.0.2",
"node-vibrant": "4.0.4",
@@ -136,24 +136,24 @@
},
"devDependencies": {
"@ampproject/remapping": "2.3.0",
"@babel/core": "8.1.0",
"@babel/core": "8.1.3",
"@babel/helper-compilation-targets": "8.0.7",
"@babel/helper-define-polyfill-provider": "1.0.0",
"@babel/plugin-transform-class-properties": "8.0.1",
"@babel/plugin-transform-private-methods": "8.0.1",
"@babel/plugin-transform-runtime": "8.0.6",
"@babel/plugin-transform-runtime": "8.1.2",
"@babel/preset-env": "8.0.7",
"@bundle-stats/plugin-webpack-filter": "4.23.1",
"@eslint/js": "10.0.1",
"@gfx/zopfli": "1.0.15",
"@home-assistant/components": "workspace:*",
"@html-eslint/eslint-plugin": "0.67.0",
"@html-eslint/eslint-plugin": "0.68.0",
"@lokalise/node-api": "17.0.1",
"@octokit/auth-oauth-device": "8.0.5",
"@octokit/rest": "22.0.1",
"@playwright/test": "1.65.0",
"@playwright/test": "1.65.1",
"@rsdoctor/rspack-plugin": "1.6.5",
"@rspack/core": "2.3.1",
"@rspack/core": "2.3.3",
"@rspack/dev-server": "2.2.2",
"@types/babel__plugin-transform-runtime": "7.9.5",
"@types/chromecast-caf-receiver": "7.0.1",
@@ -170,17 +170,17 @@
"@types/sortablejs": "1.15.9",
"@types/tar": "7.0.87",
"@typescript/native": "npm:[email protected]",
"@vitest/coverage-v8": "5.1.0",
"@vitest/coverage-v8": "5.1.1",
"babel-loader": "10.1.1",
"babel-plugin-polyfill-corejs3": "1.0.0",
"browserslist": "4.29.5",
"browserslist": "4.29.6",
"browserslist-useragent-regexp": "4.1.4",
"core-js-compat": "3.51.0",
"del": "9.0.1",
"eslint": "10.14.0",
"eslint": "10.15.0",
"eslint-config-prettier": "10.1.8",
"eslint-import-resolver-webpack": "0.13.11",
"eslint-plugin-import-x": "4.17.1",
"eslint-plugin-import-x": "4.18.1",
"eslint-plugin-lit": "2.3.1",
"eslint-plugin-lit-a11y": "5.1.3",
"eslint-plugin-unused-imports": "4.4.1",
@@ -188,42 +188,42 @@
"fancy-log": "2.0.0",
"fs-extra": "11.4.1",
"generate-license-file": "4.2.5",
"glob": "14.0.4",
"glob": "14.0.6",
"globals": "17.14.0",
"gulp": "5.0.1",
"gulp-json-transform": "0.5.0",
"gulp-rename": "2.1.0",
"html-minifier-terser": "7.2.0",
"husky": "9.1.7",
"jsdom": "31.0.0",
"jsdom": "31.0.1",
"jszip": "3.10.2",
"license-checker-rseidelsohn": "5.0.1",
"lightningcss": "1.33.0",
"lint-staged": "17.6.0",
"lint-staged": "17.6.2",
"lit-analyzer": "2.0.3",
"lodash.merge": "4.6.2",
"lodash.template": "4.18.1",
"map-stream": "0.0.7",
"minify-literals": "2.2.0",
"pinst": "3.0.0",
"prettier": "3.9.10",
"prettier": "3.10.1",
"rspack-manifest-plugin": "5.2.2",
"serve": "14.2.6",
"serve": "14.2.8",
"sinon": "22.1.0",
"tar": "7.5.22",
"tar": "7.5.23",
"terser-webpack-plugin": "5.6.1",
"ts-lit-plugin": "2.0.2",
"typescript": "6.0.3",
"typescript-eslint": "8.72.1",
"vite": "8.3.6",
"typescript-eslint": "8.73.0",
"vite": "8.3.8",
"vite-tsconfig-paths": "6.1.1",
"vitest": "5.1.0",
"vitest": "5.1.1",
"webpack-stats-plugin": "1.1.3",
"webpackbar": "7.0.0",
"workbox-build": "7.4.1"
},
"packageManager": "pnpm@12.18.0",
"packageManager": "pnpm@12.23.0",
"volta": {
"node": "24.22.2"
"node": "24.22.3"
}
}
+1 -1
View File
@@ -53,7 +53,7 @@
},
"devDependencies": {
"@custom-elements-manifest/analyzer": "0.11.0",
"@rslib/core": "1.0.6",
"@rslib/core": "1.0.7",
"lit": "3.3.3",
"typescript": "6.0.3"
}
@@ -0,0 +1,8 @@
import { define } from "../../utils/registration/define";
import { HacSpinner } from "./hac-spinner";
import { TAG_NAME } from "./info";
// Registers <hac-spinner> in the global registry, as used by Home Assistant
define(TAG_NAME, HacSpinner);
export { HacSpinner };
@@ -0,0 +1,219 @@
import { css, html, LitElement, nothing } from "lit";
import { property } from "lit/decorators.js";
/**
* @element hac-spinner
*
* @summary
* Circular progress indicator for a task of unknown duration. Exposed to
* assistive technology as an indeterminate `progressbar`.
*
* Set `aria-hidden="true"` when the spinner only decorates text that already
* says what is in progress. It is passed on to the progressbar, because in
* Chromium the host's `aria-hidden` alone doesn't keep the label out of a
* parent's name.
*
* @csspart spinner - The `svg` element.
* @csspart base - Same as `spinner`, kept for styles written for `ha-spinner`.
* Temporary, like the legacy variables.
*
* @cssprop --hac-spinner-size - Diameter of the spinner. Overrides `size`.
* @cssprop --hac-spinner-indicator-color - Color of the moving arc.
* @cssprop --hac-spinner-track-color - Color of the track.
* @cssprop --hac-spinner-track-width - Stroke width of the track and arc.
*/
export class HacSpinner extends LitElement {
/** Preset diameter: 16, 28, 48 or 68 pixels. Defaults to 48 pixels. */
@property({ reflect: true }) public size?:
"tiny" | "small" | "medium" | "large";
/**
* Accessible name. Name what is in progress, like "Installing update",
* rather than its state. Defaults to "Loading".
*/
@property({ attribute: "accessible-label" })
public accessibleLabel?: string;
/** Name used without `accessibleLabel`. Subclasses can translate it. */
protected defaultLabel(): string {
return "Loading";
}
static get observedAttributes() {
return [...super.observedAttributes, "aria-hidden"];
}
public attributeChangedCallback(
name: string,
oldValue: string | null,
newValue: string | null
) {
super.attributeChangedCallback(name, oldValue, newValue);
if (name === "aria-hidden") {
this.requestUpdate();
}
}
protected render() {
return html`
<svg
part="spinner base"
role="progressbar"
aria-label=${this.accessibleLabel || this.defaultLabel()}
aria-hidden=${this.getAttribute("aria-hidden") ?? nothing}
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<circle class="track" />
<circle class="indicator" />
</svg>
`;
}
/*
* Fallback order: --hac-spinner-*, then the variables of ha-spinner
* (--ha-spinner-*, --primary-color, --divider-color) so existing themes and
* callers keep working, then the semantic tokens and their light values for
* use outside Home Assistant. A size preset wins over --ha-spinner-size, as
* it did in ha-spinner.
*
* --indicator-color, --track-color, --track-width and --speed are the
* variables ha-spinner inherited from wa-spinner. They are set on the host
* like they were there, so a rule on the element still overrides them but a
* value from an ancestor doesn't leak in.
*
* The ha-spinner and wa-spinner variables are temporary, see "Theming" in
* the README.
*/
static styles = css`
:host {
--indicator-color: var(
--ha-spinner-indicator-color,
var(--primary-color, var(--ha-color-fill-primary-loud-resting, #009ac7))
);
--track-color: var(
--ha-spinner-divider-color,
var(--divider-color, var(--ha-color-border-neutral-quiet, #e6e6e6))
);
--track-width: 4px;
--speed: 3.5s;
--_size: var(
--hac-spinner-size,
var(--_preset-size, var(--ha-spinner-size, 48px))
);
box-sizing: border-box;
flex: none;
display: inline-flex;
width: var(--_size);
height: var(--_size);
}
:host([hidden]) {
display: none !important;
}
:host([size="tiny"]) {
--_preset-size: 16px;
}
:host([size="small"]) {
--_preset-size: 28px;
}
:host([size="medium"]) {
--_preset-size: 48px;
}
:host([size="large"]) {
--_preset-size: 68px;
}
svg {
width: 100%;
height: 100%;
aspect-ratio: 1;
animation: spin var(--speed) linear infinite;
}
.track,
.indicator {
--_width: var(--hac-spinner-track-width, var(--track-width));
--_radius: calc(var(--_size) / 2 - var(--_width) / 2);
--_circumference: calc(var(--_radius) * 2 * 3.141592654);
cx: calc(var(--_size) / 2);
cy: calc(var(--_size) / 2);
r: var(--_radius);
fill: none;
stroke-width: var(--_width);
}
.track {
stroke: var(--hac-spinner-track-color, var(--track-color));
}
.indicator {
stroke: var(--hac-spinner-indicator-color, var(--indicator-color));
stroke-linecap: round;
stroke-dasharray:
calc(0.597 * var(--_circumference)), calc(0.796 * var(--_circumference));
stroke-dashoffset: calc(-0.04 * var(--_circumference));
animation: dash 1.5s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
svg,
.indicator {
animation: none;
}
}
/* Keep the track and the arc apart in forced colors mode */
@media (forced-colors: active) {
svg {
forced-color-adjust: none;
}
.track {
stroke: GrayText;
}
.indicator {
stroke: CanvasText;
}
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes dash {
0% {
stroke-dasharray:
calc(0.008 * var(--_circumference)),
calc(1.194 * var(--_circumference));
stroke-dashoffset: 0;
}
50% {
stroke-dasharray:
calc(0.716 * var(--_circumference)),
calc(1.194 * var(--_circumference));
stroke-dashoffset: calc(-0.278 * var(--_circumference));
}
100% {
stroke-dasharray:
calc(0.716 * var(--_circumference)),
calc(1.194 * var(--_circumference));
stroke-dashoffset: calc(-0.987 * var(--_circumference));
}
}
`;
}
declare global {
interface HTMLElementTagNameMap {
"hac-spinner": HacSpinner;
}
}
@@ -0,0 +1,5 @@
/** Tag name of the element. */
export const TAG_NAME = "hac-spinner";
/** Version of <hac-spinner>. */
export const VERSION = "0.1.0";
@@ -0,0 +1,15 @@
import type { ElementDefinition } from "../../utils/registration/definition";
import { HacSpinner } from "./hac-spinner";
import { TAG_NAME } from "./info";
export { HacSpinner };
/**
* The bundled <hac-spinner> for a scoped registry:
* `ScopedElementsMixin(LitElement, [hacSpinner])` or
* `createScopedElementRegistry([hacSpinner])`.
*/
export const hacSpinner: ElementDefinition<typeof HacSpinner> = {
tagName: TAG_NAME,
element: HacSpinner,
};
+1414 -1310
View File
File diff suppressed because it is too large. Load diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "home-assistant-frontend"
version = "20261028.0"
version = "20261125.0"
license = "Apache-2.0"
license-files = ["LICENSE*"]
description = "The Home Assistant frontend"
+1 -1
View File
@@ -14,7 +14,7 @@
"minimumReleaseAge": "3 days",
"postUpdateOptions": ["pnpmDedupe"],
"constraints": {
"ghActionsLock": "v0.4.1"
"ghActionsLock": "v0.5.1"
},
"lockFileMaintenance": {
"description": ["Run after patch releases but before next beta"],
@@ -0,0 +1,55 @@
interface EntityWithColorTemp {
attributes?: Record<string, unknown>;
}
const finiteRange = (
min: unknown,
max: unknown
): { min: number; max: number } | undefined => {
if (typeof min !== "number" || typeof max !== "number") {
return undefined;
}
if (!Number.isFinite(min) || !Number.isFinite(max) || min > max) {
return undefined;
}
return { min, max };
};
/**
* Kelvin bounds reported by the given entity states.
*
* Several lights use the overlap of their ranges, because one
* `color_temp_kelvin` value is sent to every target. When the ranges do not
* overlap, the result spans the widest range so it still has a valid min and
* max. Entities without a finite range are ignored. Returns undefined when
* nothing reports a range, so the caller keeps the selector min and max.
*/
export const kelvinRangeFromEntityStates = (
states: Readonly<Record<string, EntityWithColorTemp | undefined>> | undefined
): { min: number; max: number } | undefined => {
if (!states) {
return undefined;
}
const ranges: { min: number; max: number }[] = [];
for (const state of Object.values(states)) {
const range = finiteRange(
state?.attributes?.min_color_temp_kelvin,
state?.attributes?.max_color_temp_kelvin
);
if (range) {
ranges.push(range);
}
}
if (!ranges.length) {
return undefined;
}
let min = Math.max(...ranges.map((range) => range.min));
let max = Math.min(...ranges.map((range) => range.max));
if (min > max) {
min = Math.min(...ranges.map((range) => range.min));
max = Math.max(...ranges.map((range) => range.max));
}
return { min, max };
};
+1 -1
View File
@@ -79,7 +79,7 @@ export const generateColorPalette = (
}
return steps.map((step) => {
const name = `ha-color-${label}-${step}`;
const name = `ha-color-${label}-${String(step).padStart(2, "0")}`;
// Base color at 50%
if (step === 50) {
+8 -6
View File
@@ -6,15 +6,17 @@ const isConditionObject = (c: unknown): c is VisibilityCondition =>
typeof c === "object" && c !== null;
/**
* Drop entries that are not condition objects, at any depth. Returns the
* same array when every entry is valid.
* Drop entries that are not condition objects, at any depth. A single
* condition mapping is wrapped in an array. Returns the same array when it
* is an array and every entry is valid.
*/
export const dropInvalidConditions = (
conditions: VisibilityCondition[]
conditions: VisibilityCondition | VisibilityCondition[]
): VisibilityCondition[] => {
let changed = false;
const list = ensureArray(conditions);
let changed = list !== conditions;
const valid: VisibilityCondition[] = [];
for (const c of conditions) {
for (const c of list) {
if (!isConditionObject(c)) {
changed = true;
continue;
@@ -30,5 +32,5 @@ export const dropInvalidConditions = (
}
valid.push(c);
}
return changed ? valid : conditions;
return changed ? valid : list;
};
@@ -89,10 +89,19 @@ export class LegendFitController {
private _fit() {
const list = this._element;
const rowWidth = list?.getBoundingClientRect().width;
if (!list || !rowWidth) {
if (!list) {
return;
}
const style = getComputedStyle(list);
const rowWidth = parseFloat(style.width);
// Bounding rects include transforms, such as a dialog scaling in, which
// never resize the list, so measure in layout pixels
const scale = list.getBoundingClientRect().width / rowWidth;
if (!rowWidth || !scale) {
return;
}
const layoutWidth = (element: Element) =>
element.getBoundingClientRect().width / scale;
const children = Array.from(list.children);
const more = children.find((child) =>
child.classList.contains("legend-more")
@@ -107,9 +116,7 @@ export class LegendFitController {
}
this._more = more;
}
const widths = children
.filter((child) => child !== more)
.map((child) => child.getBoundingClientRect().width);
const widths = children.filter((child) => child !== more).map(layoutWidth);
// Values resize the items on every state update. Fitting each item at its
// widest since the last resize keeps the more button from flickering.
if (rowWidth !== this._rowWidth || widths.length !== this._widths.length) {
@@ -122,9 +129,9 @@ export class LegendFitController {
}
const fit = fitInRows(
this._widths,
more?.getBoundingClientRect().width ?? 0,
more ? layoutWidth(more) : 0,
rowWidth,
parseFloat(getComputedStyle(list).columnGap) || 0,
parseFloat(style.columnGap) || 0,
rowWidth < NARROW_WIDTH ? NARROW_MAX_ROWS : MAX_ROWS
);
if (fit !== this.fit) {
+102 -68
View File
@@ -1,4 +1,9 @@
import type { ThemeVars } from "../../data/ws-themes";
import {
getThemeVariables,
themeDefinesColor,
themeDefinesPrimaryPalette,
} from "../../data/ws-themes";
import { darkColorVariables } from "../../resources/theme/color";
import { darkSemanticVariables } from "../../resources/theme/semantic.globals";
import { derivedStyles } from "../../resources/theme/theme";
@@ -10,9 +15,9 @@ import {
rgb2hex,
rgb2lab,
} from "../color/convert-color";
import { hexBlend } from "../color/hex";
import { cssColorToHex, hexBlend } from "../color/hex";
import { labBrighten, labDarken } from "../color/lab";
import { generateColorPalette } from "../color/palette";
import { generateColorPalette, normalizeLuminance } from "../color/palette";
import { rgbContrast } from "../color/rgb";
interface ProcessedTheme {
@@ -56,78 +61,56 @@ export const applyThemesOnElement = (
themeRules = { ...darkSemanticVariables, ...darkColorVariables };
}
if (themeToApply === "default") {
// Determine the primary and accent colors from the current settings.
// Fallbacks are implicitly the HA default blue and orange or the
// derived "darkStyles" values, depending on the light vs dark mode.
const primaryColor = themeSettings?.primaryColor;
const accentColor = themeSettings?.accentColor;
const isDefaultTheme = themeToApply === "default";
const customTheme =
themeToApply && !isDefaultTheme ? themes.themes[themeToApply] : undefined;
const customThemeRules = customTheme
? getThemeVariables(customTheme, darkMode)
: undefined;
if (darkMode && primaryColor) {
themeRules["app-header-background-color"] = hexBlend(
primaryColor,
"#121212",
8
);
}
const primaryColor =
isDefaultTheme ||
(customThemeRules && !themeDefinesColor(customThemeRules, "primary"))
? themeSettings?.primaryColor
: undefined;
const accentColor =
isDefaultTheme ||
(customThemeRules && !themeDefinesColor(customThemeRules, "accent"))
? themeSettings?.accentColor
: undefined;
if (primaryColor) {
cacheKey = `${cacheKey}__primary_${primaryColor}`;
const rgbPrimaryColor = hex2rgb(primaryColor);
const labPrimaryColor = rgb2lab(rgbPrimaryColor);
themeRules["primary-color"] = primaryColor;
const rgbLightPrimaryColor = lab2rgb(labBrighten(labPrimaryColor));
if (primaryColor) {
cacheKey = `${cacheKey}__primary_${primaryColor}`;
}
if (accentColor) {
cacheKey = `${cacheKey}__accent_${accentColor}`;
}
themeRules = {
...themeRules,
...getUserColorRules(primaryColor, accentColor, isDefaultTheme && darkMode),
};
generateColorPalette(primaryColor, "primary").forEach(([key, color]) => {
themeRules[key] = color;
});
themeRules["light-primary-color"] = rgb2hex(rgbLightPrimaryColor);
themeRules["dark-primary-color"] = lab2hex(labDarken(labPrimaryColor));
themeRules["darker-primary-color"] = lab2hex(
labDarken(labPrimaryColor, 2)
);
themeRules["text-primary-color"] =
rgbContrast(rgbPrimaryColor, [33, 33, 33]) < 6 ? "#fff" : "#212121";
themeRules["text-light-primary-color"] =
rgbContrast(rgbLightPrimaryColor, [33, 33, 33]) < 6
? "#fff"
: "#212121";
themeRules["state-icon-color"] = themeRules["dark-primary-color"];
}
if (accentColor) {
cacheKey = `${cacheKey}__accent_${accentColor}`;
themeRules["accent-color"] = accentColor;
const rgbAccentColor = hex2rgb(accentColor);
themeRules["text-accent-color"] =
rgbContrast(rgbAccentColor, [33, 33, 33]) < 6 ? "#fff" : "#212121";
}
// Nothing was changed
if (element.__themes?.cacheKey === cacheKey) {
return;
}
// Nothing was changed
if (isDefaultTheme && element.__themes?.cacheKey === cacheKey) {
return;
}
// Custom theme logic (not relevant for default theme, since it would override
// the derived calculations from above)
if (
themeToApply &&
themeToApply !== "default" &&
themes.themes[themeToApply]
) {
// Apply theme vars that are relevant for all modes (but extract the "modes" section first)
const { modes, ...baseThemeRules } = themes.themes[themeToApply];
themeRules = { ...themeRules, ...baseThemeRules };
// Unparseable colors like `var(--x)` are skipped.
const themePrimaryColor =
customThemeRules?.["primary-color"] &&
!themeDefinesPrimaryPalette(customThemeRules)
? cssColorToHex(customThemeRules["primary-color"])
: undefined;
if (themePrimaryColor) {
// Older themes often use a near black primary color for the header.
themeRules = {
...themeRules,
...getPrimaryPaletteRules(normalizeLuminance(themePrimaryColor)),
};
}
// Apply theme vars for the specific mode if available
if (modes) {
if (darkMode) {
themeRules = { ...themeRules, ...modes.dark };
} else {
themeRules = { ...themeRules, ...modes.light };
}
}
if (customThemeRules) {
themeRules = { ...themeRules, ...customThemeRules };
}
if (!element.__themes?.keys && !Object.keys(themeRules).length) {
@@ -154,6 +137,57 @@ export const applyThemesOnElement = (
}
};
const getPrimaryPaletteRules = (primaryColor: string): Partial<ThemeVars> => {
const rules: Partial<ThemeVars> = {};
const labPrimaryColor = rgb2lab(hex2rgb(primaryColor));
generateColorPalette(primaryColor, "primary").forEach(([key, color]) => {
rules[key] = color;
});
rules["light-primary-color"] = rgb2hex(lab2rgb(labBrighten(labPrimaryColor)));
rules["dark-primary-color"] = lab2hex(labDarken(labPrimaryColor));
rules["darker-primary-color"] = lab2hex(labDarken(labPrimaryColor, 2));
return rules;
};
const getUserColorRules = (
primaryColor: string | undefined,
accentColor: string | undefined,
tintHeader: boolean
): Partial<ThemeVars> => {
const rules: Partial<ThemeVars> = {};
if (primaryColor) {
if (tintHeader) {
rules["app-header-background-color"] = hexBlend(
primaryColor,
"#121212",
8
);
}
Object.assign(rules, getPrimaryPaletteRules(primaryColor));
rules["primary-color"] = primaryColor;
rules["text-primary-color"] =
rgbContrast(hex2rgb(primaryColor), [33, 33, 33]) < 6 ? "#fff" : "#212121";
rules["text-light-primary-color"] =
rgbContrast(hex2rgb(rules["light-primary-color"]!), [33, 33, 33]) < 6
? "#fff"
: "#212121";
rules["state-icon-color"] = rules["dark-primary-color"];
}
if (accentColor) {
rules["accent-color"] = accentColor;
const rgbAccentColor = hex2rgb(accentColor);
rules["text-accent-color"] =
rgbContrast(rgbAccentColor, [33, 33, 33]) < 6 ? "#fff" : "#212121";
}
return rules;
};
const processTheme = (
cacheKey: string,
theme: Partial<ThemeVars>
+29
View File
@@ -0,0 +1,29 @@
const INTERACTIVE_SELECTOR = [
"a[href]",
"button",
"input",
"select",
"textarea",
"summary",
"label",
"[contenteditable]:not([contenteditable='false'])",
"[tabindex]:not([tabindex='-1'])",
"[role='button']",
"[role='link']",
"[role='checkbox']",
"[role='radio']",
"[role='switch']",
"[role='slider']",
"[role='tab']",
"[role='menuitem']",
"[role='option']",
"[role='combobox']",
"[role='textbox']",
].join(",");
/**
* Whether `node` is an element that handles clicks or keyboard input on its
* own, such as a button, link, form control or a focusable widget.
*/
export const isInteractiveElement = (node: EventTarget): boolean =>
node instanceof Element && node.matches(INTERACTIVE_SELECTOR);
+9 -1
View File
@@ -3,15 +3,23 @@ const SWIPE_LOCKED_COMPONENTS = new Set([
"ha-slider",
"ha-control-switch",
"ha-control-circular-slider",
"ha-state-control-cover",
"ha-hs-color-picker",
"ha-map",
// Charts pan and pinch-zoom on touch
"ha-chart-base",
"ha-more-info-control-select-container",
"ha-filter-chip",
// Toasts are inside the sheet while it is open
"notification-manager",
]);
const SWIPE_LOCKED_CLASSES = new Set(["volume-slider-container", "forecast"]);
const SWIPE_LOCKED_CLASSES = new Set([
"volume-slider-container",
"forecast",
// A zoomed in camera picture pans on touch
"camera-player-zoomed",
]);
/**
* Whether a touch inside a bottom sheet belongs to its content rather than to
+8
View File
@@ -0,0 +1,8 @@
/** Loads an image, resolves with undefined when it can't be loaded. */
export const loadImage = (url: string): Promise<HTMLImageElement | undefined> =>
new Promise((resolve) => {
const image = new Image();
image.onload = () => resolve(image);
image.onerror = () => resolve(undefined);
image.src = url;
});
+35
View File
@@ -0,0 +1,35 @@
// Containers of the open modal dialogs, in opening order. A child of a
// container is in the flat tree of its native modal `<dialog>`.
const OPEN_MODALS: HTMLElement[] = [];
const listeners = new Set<() => void>();
/**
* Tracks a modal dialog. While a modal is open the browser makes everything
* outside it inert, so an element that must stay interactive has to move into
* the topmost container.
*/
export const setModalOpen = (container: HTMLElement, open: boolean) => {
// A dialog removed right after it was opened still finishes opening
// afterwards, which would move the toasts off the page.
if (open && !container.isConnected) {
return;
}
const index = OPEN_MODALS.indexOf(container);
if (index === -1 && !open) {
return;
}
if (index !== -1) {
OPEN_MODALS.splice(index, 1);
}
if (open) {
OPEN_MODALS.push(container);
}
listeners.forEach((listener) => listener());
};
export const getTopModal = (): HTMLElement | undefined =>
OPEN_MODALS[OPEN_MODALS.length - 1];
export const subscribeOpenModals = (listener: () => void) => {
listeners.add(listener);
};
+21
View File
@@ -0,0 +1,21 @@
// Some WebViews become visible after thawing without dispatching visibilitychange,
// resume, or focus. Check visibility while waiting so reconnects cannot stay blocked.
export const whenDocumentVisible = (callback: () => void): (() => void) => {
const check = () => {
if (!document.hidden) {
cancel();
callback();
}
};
const interval = window.setInterval(check, 1000);
const cancel = () => {
window.clearInterval(interval);
document.removeEventListener("visibilitychange", check);
document.removeEventListener("resume", check);
window.removeEventListener("focus", check);
};
document.addEventListener("visibilitychange", check);
document.addEventListener("resume", check);
window.addEventListener("focus", check);
return cancel;
};
+5 -5
View File
@@ -1,12 +1,12 @@
import type { HomeAssistant } from "../../types";
import type { HassServices } from "home-assistant-js-websocket";
import { getToggleAction } from "./get_toggle_action";
export const canToggleDomain = (hass: HomeAssistant, domain: string) => {
const services = hass.services[domain];
if (!services) {
export const canToggleDomain = (services: HassServices, domain: string) => {
const domainServices = services[domain];
if (!domainServices) {
return false;
}
const actionOn = getToggleAction(domain, true);
const actionOff = getToggleAction(domain, false);
return actionOn in services && actionOff in services;
return actionOn in domainServices && actionOff in domainServices;
};
+13 -6
View File
@@ -1,23 +1,30 @@
import type { HassEntity } from "home-assistant-js-websocket";
import type { HomeAssistant } from "../../types";
import type {
HassEntities,
HassEntity,
HassServices,
} from "home-assistant-js-websocket";
import { canToggleDomain } from "./can_toggle_domain";
import { computeStateDomain } from "./compute_state_domain";
import { supportsFeature } from "./supports-feature";
import { SPECIAL_TOGGLE_ACTIONS } from "./get_toggle_action";
export const canToggleState = (hass: HomeAssistant, stateObj: HassEntity) => {
export const canToggleState = (
states: HassEntities,
services: HassServices,
stateObj: HassEntity
) => {
const domain = computeStateDomain(stateObj);
if (domain === "group") {
if (
stateObj.attributes?.entity_id?.some((entity) => {
const entityStateObj = hass.states[entity];
const entityStateObj = states[entity];
if (!entityStateObj) {
return false;
}
const entityDomain = computeStateDomain(entityStateObj);
return canToggleDomain(hass, entityDomain);
return canToggleDomain(services, entityDomain);
})
) {
return stateObj.state === "on" || stateObj.state === "off";
@@ -35,5 +42,5 @@ export const canToggleState = (hass: HomeAssistant, stateObj: HassEntity) => {
);
}
return canToggleDomain(hass, domain);
return canToggleDomain(services, domain);
};
@@ -5,6 +5,7 @@ import {
TEMPERATURE_ATTRIBUTES,
} from "../../data/entity/entity_attributes";
import type { EntityRegistryDisplayEntry } from "../../data/entity/entity_registry";
import { computeGroupMemberEntries } from "../../data/group";
import type { FrontendLocaleData } from "../../data/translation";
import { TimeZone } from "../../data/translation";
import type { WeatherEntity } from "../../data/weather";
@@ -182,6 +183,13 @@ export const computeAttributeValueToParts = (
localize(
`component.${registryEntry.platform}.entity.${domain}.${translationKey}.state_attributes.${attribute}.state.${attributeValue}`
)) ||
computeMemberAttributeValueDisplay(
localize,
stateObj,
entities,
attribute,
attributeValue
) ||
(deviceClass &&
localize(
`component.${domain}.entity_component.${deviceClass}.state_attributes.${attribute}.state.${attributeValue}`
@@ -193,6 +201,27 @@ export const computeAttributeValueToParts = (
return [{ type: "value", value: formattedValue }];
};
// A group has no translations for the values of its members, for example the
// effects of a light group, so use the translation of a member.
const computeMemberAttributeValueDisplay = (
localize: LocalizeFunc,
stateObj: HassEntity,
entities: HomeAssistant["entities"],
attribute: string,
attributeValue: string
): string | undefined => {
const domain = computeStateDomain(stateObj);
for (const member of computeGroupMemberEntries(stateObj, entities)) {
const translation = localize(
`component.${member.platform}.entity.${domain}.${member.translation_key}.state_attributes.${attribute}.state.${attributeValue}`
);
if (translation) {
return translation;
}
}
return undefined;
};
export const computeAttributeNameDisplay = (
localize: LocalizeFunc,
stateObj: HassEntity,
+12 -2
View File
@@ -4,16 +4,23 @@ import {
mdiArrowDown,
mdiArrowExpandHorizontal,
mdiArrowUp,
mdiDoorClosed,
mdiDoorOpen,
mdiGate,
mdiGateOpen,
} from "@mdi/js";
import type { HassEntity } from "home-assistant-js-websocket";
export const computeOpenIcon = (stateObj: HassEntity): string => {
switch (stateObj.attributes.device_class) {
case "awning":
case "door":
return mdiDoorOpen;
case "gate":
return mdiGateOpen;
case "curtain":
return mdiArrowExpandHorizontal;
case "awning":
return mdiArrowDown;
default:
return mdiArrowUp;
}
@@ -21,11 +28,14 @@ export const computeOpenIcon = (stateObj: HassEntity): string => {
export const computeCloseIcon = (stateObj: HassEntity): string => {
switch (stateObj.attributes.device_class) {
case "awning":
case "door":
return mdiDoorClosed;
case "gate":
return mdiGate;
case "curtain":
return mdiArrowCollapseHorizontal;
case "awning":
return mdiArrowUp;
default:
return mdiArrowDown;
}
+2 -17
View File
@@ -163,21 +163,9 @@ export const findEntities = (
return results;
};
export const excludeEntities = (
entityIds: string[],
excludedEntityIds?: string[]
): string[] => {
if (!excludedEntityIds?.length) {
return entityIds;
}
const excluded = new Set(excludedEntityIds);
return entityIds.filter((entityId) => !excluded.has(entityId));
};
export const findFilteredEntities = (
sources: EntityFilterSources,
filters: EntityFilter[],
excludedEntityIds?: string[]
filters: EntityFilter[]
): string[] => {
const filterFuncs = filters.map((filter) =>
generateEntityFilter(
@@ -189,8 +177,5 @@ export const findFilteredEntities = (
filter
)
);
return excludeEntities(
findEntities(Object.keys(sources.states), filterFuncs),
excludedEntityIds
);
return findEntities(Object.keys(sources.states), filterFuncs);
};
+2
View File
@@ -15,6 +15,7 @@ import { MediaPlayerEntityFeature } from "../../data/feature/media-player_entity
import { NotifyEntityFeature } from "../../data/notify";
import { RemoteEntityFeature } from "../../data/remote";
import { SirenEntityFeature } from "../../data/feature/siren_entity_feature";
import { TimerListEntityFeature } from "../../data/timer_list";
import { TodoListEntityFeature } from "../../data/todo";
import { UpdateEntityFeature } from "../../data/update";
import { VacuumEntityFeature } from "../../data/vacuum";
@@ -42,6 +43,7 @@ const DOMAIN_ENUMS = {
notify: NotifyEntityFeature,
remote: RemoteEntityFeature,
siren: SirenEntityFeature,
timer_list: TimerListEntityFeature,
todo: TodoListEntityFeature,
update: UpdateEntityFeature,
vacuum: VacuumEntityFeature,
+3
View File
@@ -51,6 +51,9 @@ export function stateActive(stateObj: HassEntity, state?: string): boolean {
return ["on", "home", "open", "locked", "problem"].includes(compareState);
case "timer":
return compareState === "active";
case "timer_list":
// The state is the number of active timers
return compareState !== "0";
case "camera":
return ["streaming", "recording"].includes(compareState);
}
+11 -4
View File
@@ -1,11 +1,18 @@
import type { HassEntity } from "home-assistant-js-websocket";
import type {
HassEntities,
HassEntity,
HassServices,
} from "home-assistant-js-websocket";
import { UNAVAILABLE } from "../../data/entity/entity";
import type { HomeAssistant } from "../../types";
import { DOMAINS_WITH_CARD } from "../const";
import { canToggleState } from "./can_toggle_state";
import { computeStateDomain } from "./compute_state_domain";
export const stateCardType = (hass: HomeAssistant, stateObj: HassEntity) => {
export const stateCardType = (
states: HassEntities,
services: HassServices,
stateObj: HassEntity
) => {
if (stateObj.state === UNAVAILABLE) {
return "display";
}
@@ -16,7 +23,7 @@ export const stateCardType = (hass: HomeAssistant, stateObj: HassEntity) => {
return domain;
}
if (
canToggleState(hass, stateObj) &&
canToggleState(states, services, stateObj) &&
stateObj.attributes.control !== "hidden"
) {
return "toggle";
+1
View File
@@ -36,6 +36,7 @@ const STATE_COLORED_DOMAIN = new Set([
"sun",
"switch",
"timer",
"timer_list",
"update",
"vacuum",
"valve",
+7 -1
View File
@@ -161,6 +161,9 @@ export const getNumberFormatOptions = (
return undefined;
};
// Intl.NumberFormat throws a RangeError for more fraction digits than this.
const MAX_FRACTION_DIGITS = 100;
/**
* Generates default options for Intl.NumberFormat
* @param num The number to be formatted
@@ -185,7 +188,10 @@ export const getDefaultFormatOptions = (
(options.minimumFractionDigits === undefined &&
options.maximumFractionDigits === undefined)
) {
const digits = num.indexOf(".") > -1 ? num.split(".")[1].length : 0;
const digits = Math.min(
num.indexOf(".") > -1 ? num.split(".")[1].length : 0,
MAX_FRACTION_DIGITS
);
defaultOptions.minimumFractionDigits = digits;
defaultOptions.maximumFractionDigits = digits;
}
+10 -2
View File
@@ -1,2 +1,10 @@
export const capitalizeFirstLetter = (str: string) =>
str.charAt(0).toUpperCase() + str.slice(1);
export const capitalizeFirstLetter = (str: string) => {
// Take the first code point, not code unit, so letters outside the BMP
// (stored as a surrogate pair) are uppercased too.
const first = str.codePointAt(0);
if (first === undefined) {
return str;
}
const firstLetter = String.fromCodePoint(first);
return firstLetter.toUpperCase() + str.slice(firstLetter.length);
};
+20 -4
View File
@@ -1,11 +1,27 @@
// Unanchored regex fragments, shared as the single source of truth for both
// the boolean validators below and the HTML `pattern` attribute (the browser
// anchors a pattern as `^(?:…)$`).
const IPV4 =
"(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";
const IPV6 =
"(?:([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|::(ffff(:0{1,4})?:)?((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))";
// Decimal octet 0-255 without leading zeros.
const DEC_OCTET = "(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])";
const IPV4 = `(?:${DEC_OCTET}\\.){3}${DEC_OCTET}`;
// IPv6 grammar from RFC 3986, section 3.2.2.
const H16 = "[0-9a-fA-F]{1,4}";
const LS32 = `(?:${H16}:${H16}|${IPV4})`;
const IPV6 = `(?:${[
`(?:${H16}:){6}${LS32}`,
`::(?:${H16}:){5}${LS32}`,
`(?:${H16})?::(?:${H16}:){4}${LS32}`,
`(?:(?:${H16}:){0,1}${H16})?::(?:${H16}:){3}${LS32}`,
`(?:(?:${H16}:){0,2}${H16})?::(?:${H16}:){2}${LS32}`,
`(?:(?:${H16}:){0,3}${H16})?::${H16}:${LS32}`,
`(?:(?:${H16}:){0,4}${H16})?::${LS32}`,
`(?:(?:${H16}:){0,5}${H16})?::${H16}`,
`(?:(?:${H16}:){0,6}${H16})?::`,
].join("|")})`;
// CIDR prefix lengths: 0-32 for IPv4, 0-128 for IPv6.
const IPV4_PREFIX = "(?:3[0-2]|[12]?[0-9])";
+2 -2
View File
@@ -1,8 +1,8 @@
// https://gist.github.com/hagemann/382adfc57adbd5af078dc93feef01fe1
export const slugify = (value: string, delimiter = "_") => {
const a =
"àáâäæãåāăąабçćčđďдèéêëēėęěеёэфğǵгḧхîïíīįìıİийкłлḿмñńǹňнôöòóœøōõőоṕпŕřрßśšşșсťțтûüùúūǘůűųувẃẍÿýыžźżз·";
const b = `aaaaaaaaaaabcccdddeeeeeeeeeeefggghhiiiiiiiiijkllmmnnnnnoooooooooopprrrsssssstttuuuuuuuuuuvwxyyyzzzz${delimiter}`;
"àáâäæãåāăąабçćčđďдèéêëēėęěеёэфğǵгḧîïíīįìıİийкłлḿмñńǹňнôöòóœøōõőоṕпŕřрßśšşșсťțтûüùúūǘůűųувẃẍÿýыžźżз·";
const b = `aaaaaaaaaaabcccdddeeeeeeeeeeefggghiiiiiiiiijkllmmnnnnnoooooooooopprrrsssssstttuuuuuuuuuuvwxyyyzzzz${delimiter}`;
const p = new RegExp(a.split("").join("|"), "g");
const complex_cyrillic = {
ж: "zh",
@@ -0,0 +1,33 @@
import type { LocalizeFunc } from "./localize";
const YAML_ERROR_REASON_KEYS = new Map(
Object.entries({
"duplicated mapping key": "duplicated_mapping_key",
"bad indentation of a mapping entry": "bad_mapping_indentation",
"bad indentation of a sequence entry": "bad_sequence_indentation",
"deficient indentation": "deficient_indentation",
"tab characters must not be used in indentation": "tab_indentation",
"can not read a block mapping entry; a multiline key may not be an implicit key":
"multiline_implicit_key",
"a whitespace character is expected after the key-value separator within a block mapping":
"missing_key_value_space",
"expected ':' after a mapping key": "missing_colon",
"missed comma between flow collection entries": "missing_comma",
"unexpected end of the stream within a flow collection":
"unterminated_flow_collection",
"unexpected end of the stream within a single quoted scalar":
"unterminated_single_quote",
"unexpected end of the stream within a double quoted scalar":
"unterminated_double_quote",
"end of the stream or a document separator is expected":
"unexpected_content",
} as const)
);
export const localizeYamlErrorReason = (
localize: LocalizeFunc,
reason: string | undefined
): string | undefined => {
const key = reason ? YAML_ERROR_REASON_KEYS.get(reason) : undefined;
return key ? localize(`ui.components.yaml-editor.reasons.${key}`) : reason;
};
+5 -1
View File
@@ -3,6 +3,7 @@ import type { HTMLTemplateResult } from "lit";
import { polyfillLocaleData } from "../../resources/polyfills/locale-data-polyfill";
import type { Resources, TranslationDict } from "../../types";
import { fireEvent } from "../dom/fire_event";
import { NAME_PLACEHOLDERS } from "./name-placeholders";
// Exclude some patterns from key type checking for now
// These are intended to be removed as errors are fixed
@@ -140,7 +141,10 @@ export const computeLocalize = async <Keys extends string = LocalizeKeys>(
}
try {
return translatedMessage.format<string>(argObject) as string;
return translatedMessage.format<string>({
...NAME_PLACEHOLDERS,
...argObject,
}) as string;
} catch (err: any) {
// eslint-disable-next-line no-console
console.error("Translation error", key, language, err);
@@ -0,0 +1,5 @@
export const MARKETPLACE_NAME = "Marketplace";
export const NAME_PLACEHOLDERS = {
marketplace: MARKETPLACE_NAME,
};
Loaded 100 of 819 files, more files were not shown because too many files have changed in this diff. Show more