fix(publish): keep the order of existing include_entities #4

Merged
mkrieger merged 1 commit from fix/keep-include-entities-order into main 2026-10-26 12:45:05 +00:00
Owner

Description

Fixes the publish preview showing entries as removed and added again when only their position in include_entities changed. Entries that are already in the file keep their position, switched-off entries drop out and new ones are appended at the end. The preview no longer shows moved entries as removed and added.

Before, the list was rebuilt in the order of the UI (the Home Assistant entity order) instead of the order in the file. In a real alexa.yaml, this made button.011030425365001108_start_pause appear as removed in one place and added in another, although it stayed in the file.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test update

Changes Made

  • planAlexaUpdate in ha-config.util.ts now keeps the existing order of include_entities: entries that are still wanted stay in place, switched-off entries drop out, new entries are appended in the order of the UI
  • Entries of domains the UI does not manage are kept as before
  • The entity count and the entity_config handling are unchanged
  • New test for the order of existing entries and appended new ones
  • Changelog entry and version bump to 1.0.33

Closes #

Testing

  • Tests pass locally
  • Added new tests for new functionality
  • Updated existing tests
  • Manual testing performed

The new test sends the entities in a different order than the file and checks that the file order is kept and the new entry comes last. Checked manually with a real alexa.yaml: the preview shows only the four new entries instead of the moved one.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Additional Notes

After the merge, tag v1.0.33 on main.

## Description Fixes the publish preview showing entries as removed and added again when only their position in `include_entities` changed. Entries that are already in the file keep their position, switched-off entries drop out and new ones are appended at the end. The preview no longer shows moved entries as removed and added. Before, the list was rebuilt in the order of the UI (the Home Assistant entity order) instead of the order in the file. In a real `alexa.yaml`, this made `button.011030425365001108_start_pause` appear as removed in one place and added in another, although it stayed in the file. ## Type of Change - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [x] Test update ## Changes Made - `planAlexaUpdate` in `ha-config.util.ts` now keeps the existing order of `include_entities`: entries that are still wanted stay in place, switched-off entries drop out, new entries are appended in the order of the UI - Entries of domains the UI does not manage are kept as before - The entity count and the `entity_config` handling are unchanged - New test for the order of existing entries and appended new ones - Changelog entry and version bump to 1.0.33 ## Related Issues Closes # ## Testing - [x] Tests pass locally - [x] Added new tests for new functionality - [ ] Updated existing tests - [x] Manual testing performed The new test sends the entities in a different order than the file and checks that the file order is kept and the new entry comes last. Checked manually with a real `alexa.yaml`: the preview shows only the four new entries instead of the moved one. ## Checklist - [x] My code follows the project's style guidelines - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings or errors - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [x] Any dependent changes have been merged and published ## Screenshots (if applicable) <!-- Optional: preview before and after the fix --> ## Additional Notes After the merge, tag `v1.0.33` on `main`.
fix(publish): keep the order of existing include_entities
All checks were successful
CI / Lint (pull_request) Successful in 15s
CI / Test (pull_request) Successful in 1m28s
CI / Build (pull_request) Successful in 28s
CI / Docker Build (pull_request) Has been skipped
Code Quality / Code Quality Checks (pull_request) Successful in 32s
Code Quality / Security Audit (pull_request) Successful in 10s
Code Quality / Bundle Size Check (pull_request) Successful in 25s
CI / E2E Tests (pull_request) Successful in 3m6s
7f58289214
Entries that are already in the file keep their position, switched-off entries drop out and new ones are appended.
The preview no longer shows moved entries as removed and added.
mkrieger deleted branch fix/keep-include-entities-order 2026-10-26 12:45:06 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mkrieger/alexa_share!4
No description provided.