* 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>
* 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>
* Don't present toggle as a ui_action option for untoggleable entities
* Fix climate enums
* unmemoize
* fix test
* Add button/valve to canToggleDomain
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>
* 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>
* 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>
* 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