Commit Graph

107 Commits

Author SHA1 Message Date
Tobias Bieniek
e48918442c Invert floor sort order to match physical layout (#27580) 2025-10-23 15:39:58 +02:00
Petar Petrov
e432f0a8ee Fix date test to work on Oct 20 (#27575)
* Fix date test to work on Oct 20

* tweak
2025-10-20 10:39:04 +00:00
Tobias Bieniek
e3a1d0abe2 data/floor_registry: Use 9999 fallback for null floor levels (#27559)
Change the fallback for null floor levels from 0 to 9999, ensuring floors
without a defined level appear at the bottom when sorted (after all numbered
floors, including negative basement levels).

This matches the original intent from #20206 which added support for floors
without levels.
2025-10-20 11:43:59 +03:00
Paul Bottein
8a42d15bde Use entity naming in more cards and badges (#27541)
* Add support for button card, glance card and entities card

* Add tests

* Add support for attribute and button row

* Add support to heading badge

* Undo changes from rows

* Add comment
2025-10-19 14:08:28 +02:00
Tobias Bieniek
5f71938d60 Consolidate floor sorting with floorCompare() (#27553)
* data/floor_registry: Fix `floorCompare()` argument type

* data/floor_registry: Add test suite for `floorCompare()` fn

* data/floor_registry: Add level-based sorting to `floorCompare()`

Update `floorCompare()` to include level-based sorting between custom order
and name sorting, matching the pattern used in the `getFloors()` helper.

Sort priority:
1. Custom order (if provided)
2. Floor level (lower levels first, with 0 fallback for null)
3. Floor name (alphabetical)

This makes `floorCompare()` consistent with the floor sorting logic used
throughout the codebase and prepares it for actual use.

* areas-strategy-helper: Use `floorCompare()` in `getFloors()` helper

Replace duplicated floor sorting logic in `getFloors()` with the
centralized `floorCompare()` function, matching the pattern used
for areas with `areaCompare()`.

This eliminates code duplication and ensures consistent floor sorting
across the codebase.

* data/area_floor: Use `floorCompare()` in `getAreasAndFloors()`

Replace duplicated floor sorting logic in `getAreasAndFloors()` with
`floorCompare()`, passing `haFloors` directly since it's already in
the correct format (Record<string, FloorRegistryEntry>).

This ensures consistent floor sorting across the codebase.
2025-10-18 18:16:30 +00:00
Wendelin
77874aa2d7 New target picker (#27284)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-14 16:16:34 +02:00
Petar Petrov
d1093b187f Improved Sankey layout (#26787)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-14 13:53:11 +02:00
Paul Bottein
ad2ba63155 Use entity naming in cards and badges (#27428) 2025-10-13 15:43:17 +02:00
Paul Bottein
f2c5b91def Revert "Add media playback badge for Area card (#26893)" (#27413)
This reverts commit 7c7a4e61f2.
2025-10-08 15:59:37 +02:00
Paul Bottein
b87ffbd4f7 Add name preset to tile card (#27065) 2025-10-08 08:13:54 +00:00
Phil White
7c7a4e61f2 Add media playback badge for Area card (#26893) 2025-09-29 09:58:57 +02:00
Paul Bottein
bd88b91071 Order tile card config according to struct (#27060) 2025-09-16 15:13:37 +03:00
Paul Bottein
af31b5add3 Add formatEntityName helper on hass object. (#26057) 2025-09-15 14:18:52 +00:00
Wendelin
68c1a38231 Unit tests for common/entity/get_states (#27007) 2025-09-15 09:28:02 +02:00
Wendelin
012e710e45 Test-device-tracker-entity-filter (#26881) 2025-09-04 16:08:38 +02:00
Drinor Dalipi
3a70310f78 Follow-up: revert ultimate fallback to undefined in computeEntityEntryName (#26629) 2025-08-21 09:50:48 +02:00
Drinor Dalipi
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
Christoph
8d95f0d95d add unit tests for common/url/search-params.ts (#26115) 2025-07-09 14:11:28 +03:00
karwosts
5cf8b39703 Coerce all energy distribution values to the same unit (#26117) 2025-07-09 14:06:47 +03:00
Kevin Lakotko
8cc762d839 Fix use of numeric option for collator (#25917)
* fix(string): use numeric option for collator

* test: add natural sort comparison tests
2025-06-30 18:00:45 +02:00
Leon
e7a04eb3d2 Short-format negative and small numbers in energy-distribution-card (#25862) 2025-06-25 13:22:21 +00:00
Bastian
f47336392c Fix/dhcp config network sort (#25799)
* Add ip sort method to compare helper

* Add ip sort functionality to dhcp config panel datatable

* Add type ip to DataTableColumnData

* Change ip sorting to padStart method for better readablity

* Rename ip compare method to clarify ipv4

* Enhance IP compare method to include ipv6

* Add compare IP test
2025-06-20 15:01:02 +03:00
Timothy
8b87188075 Add navigate command to the external bus (#25516) 2025-05-19 13:22:19 +00:00
karwosts
28e5a30772 Prioritize battery consumption before solar consumption (#25467) 2025-05-15 10:32:07 +03:00
Wendelin
84def48222 Add tests for common name utils (#25373) 2025-05-08 16:59:28 +03:00
karwosts
821a0bc418 New solar-consumed-gauge algorithm (#25326)
* New solar-consumed-gauge algorithm

* update tests

* Apply suggestion

* reduce duplicate code
2025-05-07 17:35:24 +03:00
karwosts
cd3e4f55e2 Fix typo in energy calculation (#25259)
* New energy calculation

* more tests and stricter tests. change priority order

* more test and fix error
2025-05-01 07:27:11 +03:00
karwosts
f8d706277d New energy calculation formula (#25242)
* New energy calculation

* more tests and stricter tests. change priority order
2025-04-30 19:47:51 +03:00
karwosts
92353ebed5 Centralize energy usage calculations (#25197)
* Centralize energy usage calculations

* addl tests

* test organization

* Update src/data/energy.ts

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

* Centralize more equations

---------

Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
2025-04-30 06:57:26 +03:00
Paul Bottein
536602580d Remove duplicated context files (#25212) 2025-04-29 11:51:05 +02:00
Wendelin
7a617600ad Add unit tests and docs for common/context (#25158) 2025-04-24 16:57:29 +02:00
karwosts
4c6a5ed2e3 convert-color: color names should be case insensitive (#25140)
convert-color: colornames should be case insensitive
2025-04-23 08:14:53 +03:00
Paul Bottein
20d357fb13 Add tests for get duplicates function (#24994) 2025-04-11 08:47:42 +02:00
karwosts
9f05f4df50 Short-format numbers in energy-distribution-card (#24716) 2025-03-24 12:43:11 +01:00
karwosts
d4717f1293 Handle short form hex colors in conversion functions (#24642)
* Handle short form hex colors in conversion functions

* drop alpha codes
2025-03-16 09:13:13 +01:00
Bram Kragten
dda7de3301 Fix issues with develop and serve (#24602)
* fix issues with develop and serve

* fix get image data, use hassUrl

* save picture-upload

* Update bundje.cjs

* Prettier

* Fix profile picture in dev serve mode

* person badge too

---------

Co-authored-by: Wendelin <w@pe8.at>
2025-03-12 16:59:40 +01:00
Paul Bottein
616c1fda81 Rename entity filter to entity domain filter (#24587) 2025-03-10 13:34:15 -04:00
Wendelin
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
Logan Rosen
c7a46ec25b Improve ESLint config (#24290)
* Improve ESLint config
2025-02-18 17:30:36 +00:00
Adam Kapos
0256da511d Fix theme2hex with custom theme colors (#24282) 2025-02-18 08:04:46 +01:00
Paul Bottein
3ee3cfa6cb Add cache for markdown card and markdown element (#24217)
* Add cache for markdown card and markdown element

* Rename to expiration

* Only use cache logic for markdown card

* Add tests

* Improve tests
2025-02-17 09:01:44 +01:00
Wendelin
63a98155cd Add more unit tests for common/entity (#24182)
* Add new entity tests

* Improve canToggleDomain test
2025-02-14 21:55:23 +01:00
Wendelin
03a415beff Onboarding restore use core api (#23920)
* Fix type issues

* Extract backup-upload

* Add onboarding upload section

* Extract and use ha-backup-details

* Implement backup details and restore

* remove unused hassio onboarding calls

* Require hass in dialog-hassio-backup

* Add restore view

* Add formatDateTime without locale and config

* Add restore status

* Fix prettier

* Fix styles of backup details

* Remove unused localize

* Fix onboarding restore translations

* Hide data-picker on core only instance

* Split uploadBackup into 2 separate funcs

* Add formatDateTimeWithBrowserDefaults

* Fix selected data for core only

* Show error reasons on status page

* Use new backup info agents

* Add mem function for formatDateTimeWithBrowserDefaults

* Fix overflow on mobile

* Handle errors when in hassio mode

* Fix cancel restore texts

* Fix hassio localize type issue

* Remove unused onboarding localize in hassio backup restore

* improve format_date_time

* Fix tests

* Fix and simplify backup upload issues

* Use foreach instead of reduce

* Fix attributes, unused styles and properties

* Simplify supervisor warning

* Fix language type issues

* Fix ha-backup-data-picker

* Improve backup-details-restore

* Fix onboarding-restore issues

* Improve loadBackupInfo

* Revert uploadBackup changes

* Improve cancel restore

* Use destructive

* Update src/panels/config/backup/dialogs/dialog-upload-backup.ts

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

* Show backup type not at onboarding

* Only show backup type in correct translationPanel

* Fix quotes

---------

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2025-02-10 16:40:08 +01:00
Wendelin
853059ac73 Add tests for common/datetime (#23658) 2025-01-09 15:47:32 +01:00
Ville Skyttä
3d1817a6b9 Spelling and grammar fixes (#23598) 2025-01-06 12:10:34 +01:00
Wendelin
523c38a83e Add tests for common/config (#23349)
* Add tests for common/config

* Revert version dev hook
2024-12-22 16:05:17 +01:00
Wendelin
0a28bbdd72 Improve picture select crop error handling (#23352)
* Improve crop editor error handling

* Add tests for data/image_upload

* Fix tests imports
2024-12-22 15:45:37 +01:00
libe.net
b84e00b312 Unit Test for shiftDateRange (#23324)
Unit Test for Pull 23228

Co-authored-by: Wendelin <12148533+wendevlin@users.noreply.github.com>
2024-12-19 15:42:31 +01:00
Wendelin
27ce395d68 Common-color-tests (#23258) 2024-12-12 14:44:17 +01:00
Wendelin
8f19c0abb0 Use localStorage with Web Storage API (#23172) 2024-12-10 11:14:15 +01:00