56 Commits
Author SHA1 Message Date
a9cc47888a Add child devices to the device registry (#53617)
* Add child devices to the device registry

Child devices arrive over the WebSocket as stripped entries in the flat
config/device_registry/list response (discriminated by the absence of
full-device fields). Resolve them into complete DeviceRegistryEntry
objects at ingestion so hass.devices only ever holds full entries and the
~200 downstream consumers stay unchanged:

- config-entry association comes from the child's own config_entry_id, so
  children still appear under their integration;
- hardware/display fields are inherited from the parent device;
- connections/via_device_id are not inherited.

Adds parent_device_id and the new "device" disabled_by value to the types.

Frontend data layer for home-assistant/core#178666.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Resolve child device effective area in the UI

A child device without an area of its own inherits its parent's area,
mirroring core's async_get_effective_area_id. getDeviceArea now takes the
devices map and falls back to the parent, so children show in the parent's
area everywhere a normal device would: the device dashboard (area column,
grouping and filtering via computeDeviceAreaLabel) and the device page
header.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Address review on child devices data layer

- Discriminate stripped child entries on `connections` (present on every full
  device, never on a stripped child) instead of the deprecated `config_entries`
  compatibility field that core plans to remove.
- Make getDeviceArea's `devices` argument required and update all callers, so a
  child device's effective (inherited) area is resolved consistently everywhere,
  including the device picker's selected-value renderer and the integration
  device rows.
- Lock the enable switch in the device settings dialog when a device is disabled
  by its parent (disabled_by "device"); core ignores enabling a child while its
  parent is disabled.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Inherit the parent device area when resolving entity areas

Extract getDeviceAreaId so an entity on a child device resolves to the child's
effective area (the parent's area when the child has none), matching core's
entity area resolution. Applies to both getEntityAreaId and
getEntityEntryContext, which previously read device.area_id directly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-13 11:57:28 +03:00
1f14f8689c Cleanup some toggle behavior (#53242)
* Cleanup some toggle behavior

* fix tests

* prior behavior did not consider off

* Revert "prior behavior did not consider off"

This reverts commit 59cc93d308.

* Attempt rearranging features to address bundle growth failure

* Revert a no-longer-needed change to setup.ts

* Add test

* test

* Apply suggestion from @MindFreeze

---------

Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
2026-07-23 06:09:03 +00:00
karwostsandGitHub 4fa09b0085 Don't present toggle as a ui_action option for untoggleable entities (#53210)
* Don't present toggle as a ui_action option for untoggleable entities

* Fix climate enums

* unmemoize

* fix test

* Add button/valve to canToggleDomain
2026-07-22 08:13:39 +03:00
Paul BotteinandGitHub 047ebd4524 Sync entity constants with core (#53223)
* Sync entity constants with core

* Suggest mean statistics graphs for measurement_angle sensors
2026-07-21 21:45:12 +02:00
89bd1058df Fix gauge card dropping negative and monetary values (#52751)
The gauge card reads its display value from the formatted state parts.
A monetary value is split into multiple value parts around the currency
symbol, so the minus sign lands in its own part. Taking only the first
value part meant a value like -182.95 GBP rendered as just "-".

Join all value parts so the full number is shown again.

Co-authored-by: Simon Lamon <32477463+silamon@users.noreply.github.com>
2026-06-20 08:45:28 +02:00
Paul BotteinandGitHub 405727502f Fix negative monetary (#52766)
* Fix rendering of negative monetary values

* Fix tests
2026-06-20 08:34:47 +02:00
karwostsandGitHub d98eb47490 Decode supported features in more-info-details (#52712)
* Decode supported features in more-info-details

* Remove 'Supported features' translation entry
2026-06-17 18:33:18 +02:00
Paul BotteinandGitHub 1c38d80ab2 Fix flash of unformatted entity states on first load (#52663) 2026-06-16 11:42:39 +03:00
Petar PetrovandGitHub 455fa45b9c Show battery state of charge on the energy distribution card (#51812)
* Show battery state of charge on the energy distribution card

* css tweak

* Only show SOC-based battery icon when the period includes now
2026-05-12 08:38:04 +03:00
Petar PetrovandGitHub 71b8676e02 Treat unregistered entities as having no entity_category (#51925) 2026-05-08 20:06:31 +02:00
fa2c0278cb Add UPTIME sensor device class (#51716)
Co-authored-by: Copilot <copilot@github.com>
2026-04-29 07:20:40 +02:00
WendelinandGitHub b73707751a Z-Wave rebuild routes add detail progress (#51361)
* WIP new dialog use states

* WIP add zwave rebuild network routes details

* Enhance Z-Wave JS rebuild network routes dialog with loading indicators and improved progress handling

* Remove hass param from `domain-icon`

* Remove unneeded @states

* List more compact

* fix prettier

* fix tests

* Rename device context to getDeviceArea
2026-04-02 16:51:33 +03:00
Paul BotteinandGitHub 2bd8a657b8 Revert entity naming change (#30384) 2026-03-27 21:45:54 +01:00
Petar PetrovandGitHub d8a3939e22 Fix negative currency display on sensor card (#30359) 2026-03-27 12:29:58 +01:00
Paul BotteinandGitHub f9471d6b4c Replace computeLovelaceEntityName with hass.formatEntityName (#30351) 2026-03-26 17:01:26 +01:00
Paul BotteinandGitHub 97dcc62ae7 Simplify entity name computation (#30147)
* WIP: start entity naming cleanup

* Clean device page

* Remove rename device logic

* Remove rename device logic in zwavejs

* Fix tests

* Fix entity name fallback

* Add test

* Fix type name

* Update name field in entity registry editor
2026-03-17 11:11:38 +01:00
Petar PetrovandGitHub 2d1e211034 Fix negative monetary values displayed as positive (#30178) 2026-03-17 09:11:15 +01:00
e6c9e81082 Add formatEntityStateToParts() + use it for hui-entity-card & ha-state-label-badge (#29239)
* add formatEntityStateToParts

* add formatEntityStateToParts

* use formatEntityStateToParts

* add formatEntityStateToParts

* use formatEntityStateToParts

* add formatEntityStateToParts

* add formatEntityStateToParts

* add computeStateDisplayToParts

* update for monetary

* fix a test for monetary

* fixed test for monetary

* do not include "order" into result

* do not include "order" into result

* do not include "order" into result

* do not include "order" into result

* do not include "order" into result

* do not include "order" into result

* do not include "order" into result

* simplify

* ensure less conflicts in future merges

* Refactor monetary computing

---------

Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
2026-02-09 15:11:05 +01:00
0daf94e98f Quick bar: new design and area search (#28678)
* Add "Commands" title to quick bar translations in English

* Enhance QuickBar dialog handling and localize commands title

* add nav icons

* Add icons and styles and separate navigation from commands

* handle non admin

* Add areas

* Fix import and shortcuts

* Restructure

* remove area sort

* move keys

* area search keys review

* Fix adaptive dialog slots without header

* Design review

* Review marcin

* Fix safe area bottom

* Fix ios focus

* Make it clearable

---------

Co-authored-by: Simon Lamon <32477463+silamon@users.noreply.github.com>
2026-01-15 09:45:57 +02:00
renovate[bot]GitHubrenovate[bot] <29139614+renovate[bot]@users.noreply.github.com>Petar Petrov
8f335668db Update Node.js to v24 (#27687)
* Update Node.js to v24

* fix test

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
2025-12-15 14:56:48 +02:00
WendelinandGitHub 9f16ce7341 Fix picker initial sort and reorganize picker data (#28476) 2025-12-11 08:28:45 +01:00
Paul BotteinandGitHub d59d436080 Display entities without area in summary dashboard (#27777)
* Add support for no area, no floor and no device in entity filter

* Display entities without area in summary dashboard
2025-11-04 12:10:18 +02:00
Aarni KoskelaandGitHub 3ad2f35f29 Add support for PM4 sensor state (#27754) 2025-11-02 16:54:40 +00:00
77874aa2d7 New target picker (#27284)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-14 16:16:34 +02:00
Paul BotteinandGitHub f2c5b91def Revert "Add media playback badge for Area card (#26893)" (#27413)
This reverts commit 7c7a4e61f2.
2025-10-08 15:59:37 +02:00
Paul BotteinandGitHub b87ffbd4f7 Add name preset to tile card (#27065) 2025-10-08 08:13:54 +00:00
Phil WhiteandGitHub 7c7a4e61f2 Add media playback badge for Area card (#26893) 2025-09-29 09:58:57 +02:00
Paul BotteinandGitHub af31b5add3 Add formatEntityName helper on hass object. (#26057) 2025-09-15 14:18:52 +00:00
WendelinandGitHub 68c1a38231 Unit tests for common/entity/get_states (#27007) 2025-09-15 09:28:02 +02:00
WendelinandGitHub 012e710e45 Test-device-tracker-entity-filter (#26881) 2025-09-04 16:08:38 +02:00
Drinor DalipiandGitHub 3a70310f78 Follow-up: revert ultimate fallback to undefined in computeEntityEntryName (#26629) 2025-08-21 09:50:48 +02:00
Drinor DalipiandGitHub 8b73d664b4 Fix entities not showing due to JavaScript crash (fixes #25363) (#26599)
* Fix entity UI crash from undefined entity names (fixes #25363)

* Fix mock function type compatibility in test

- Update mock to handle string | undefined parameter
- Maintain test functionality while satisfying type checker

* Simplify approach based on reviewer feedback

- Use String() coercion to preserve numeric entity names (e.g., power strip outlets)
- Single line change instead of complex type validation across multiple files
- Revert stripPrefixFromEntityName to original (no longer needs null handling)
- Remove separate test file, update existing test to expect stringified numbers
- More conservative approach that preserves data rather than replacing with fallbacks
2025-08-20 06:10:13 +00:00
WendelinandGitHub 84def48222 Add tests for common name utils (#25373) 2025-05-08 16:59:28 +03:00
Paul BotteinandGitHub 536602580d Remove duplicated context files (#25212) 2025-04-29 11:51:05 +02:00
WendelinandGitHub 7a617600ad Add unit tests and docs for common/context (#25158) 2025-04-24 16:57:29 +02:00
Paul BotteinandGitHub 616c1fda81 Rename entity filter to entity domain filter (#24587) 2025-03-10 13:34:15 -04:00
WendelinandGitHub 0a05dd8f71 Add more tests for common/entity (#24336)
* Use substring instead of deprecated substr

* Add more common entity tests
2025-02-20 20:11:53 +01:00
WendelinandGitHub 63a98155cd Add more unit tests for common/entity (#24182)
* Add new entity tests

* Improve canToggleDomain test
2025-02-14 21:55:23 +01:00
Ville SkyttäandGitHub 3d1817a6b9 Spelling and grammar fixes (#23598) 2025-01-06 12:10:34 +01:00
af1622e306 Show unit for number domains (#23101)
* Show unit for number domains

* Remove duplicated code

* Allow monetary formatting

Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>

* Update src/common/entity/compute_state_display.ts

---------

Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
2024-12-04 11:25:29 +00:00
bd0bfc1fbe Rspack (#22807)
* Add rspack

* Remove TransformAsyncModulesPlugin from rspack

* Migrate all webpack usage to rspack

* Migrate tests to vitest

* Fix test suites

* Remove chai dependency

* Fix compute_state_display tests

* Fix resolveTimeZone

* Reduces test pipeline

* Revert test ci

* optimize chunk filtering

* Migrate landing-page to rspack

* Update rspack dependencies

* Add rsdoctor

* Fix prod build bundle size

* Use rsdoctor for demo stats

* Remove unused webpack configs

* Update build-scripts/rspack.cjs

Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>

* Fix eslint

* Update rspack

* Remove unused code

---------

Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
2024-11-26 14:49:13 +01:00
Abílio CostaandGitHub 84f7c62ee2 Add support for unit_of_measurement translation (#22868) 2024-11-20 18:44:44 +01:00
karwostsandGitHub ce9993fd36 Use finishes_at in timer remaining calculation (#22169)
* Use finishes_at in timer remaining calculation

* lint

* fix test
2024-10-01 14:05:01 +02:00
f617426808 Bake numeric device classes into formatEntityState (#19878)
* Bake numeric device classes into formatEntityState

* Apply suggestions from code review

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

---------

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2024-05-24 16:17:23 +02:00
Paul BotteinandGitHub 6c7efc17c2 Fix more info type test (#17758) 2023-08-31 22:37:25 +02:00
Bram KragtenandGitHub 780de42e4b Allow to show times in the UI in the timezone of the server (#16799) 2023-06-13 12:12:13 +02:00
Christoph Wen, B.ScandGitHub 2ad6253b72 Add setting to localize numeric dates independent from language (#15770) (#16489) 2023-05-30 19:39:27 +00:00
Steve RepsherandGitHub aa3fd70966 Use Babel runtime for helpers and regenerator (33%+ bundle reduction) (#16466) 2023-05-08 14:47:53 +02:00
0158d7e3e5 Adjust backend translations for entity components (#15820)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2023-03-16 13:51:38 +01:00
d15d339782 Entity state colors theming (#14831)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2023-01-23 09:28:38 +01:00