Skip to content

Fix scene edit not showing or saving HA/OpenHAB entity binding#372

Open
jamesmulcahy wants to merge 1 commit intoNSPManager:develfrom
jamesmulcahy:fix-scene-edit-ha-binding
Open

Fix scene edit not showing or saving HA/OpenHAB entity binding#372
jamesmulcahy wants to merge 1 commit intoNSPManager:develfrom
jamesmulcahy:fix-scene-edit-ha-binding

Conversation

@jamesmulcahy
Copy link
Copy Markdown
Contributor

@jamesmulcahy jamesmulcahy commented May 2, 2026

Summary

  • When editing an existing scene, the HA/OpenHAB entity selector was never rendered because entity_source and the items list were not passed to the template
  • The save handler also ignored backend_name from the POST data when editing, so even if the field had been visible, the selection would not have been saved

Changes

partial_entity_edit_scene_entity() now populates entity_source, backend_name, and the relevant items list (HA or OpenHAB) so the entity selector renders with the current binding pre-selected.

create_or_update_scene_entity() now updates backend_name when saving an existing HA or OpenHAB scene.

Test plan

  • Edit an existing Home Assistant scene — confirm the HA entity selector appears with the current binding selected
  • Change the HA entity and save — confirm the new binding is persisted
  • Edit an existing OpenHAB scene — confirm the same behaviour
  • Edit an NSPM-native scene — confirm no entity selector appears (unchanged behaviour)
  • Create a new scene — confirm the add flow is unaffected

🤖 Generated with Claude Code

When editing an existing scene, the modal only showed the name field —
the Home Assistant / OpenHAB entity selector was hidden because
entity_source and the items list were never passed to the template, and
the save handler ignored any backend_name submitted.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tpanajott
Copy link
Copy Markdown
Collaborator

I think I'll wait to see if I need to merge this PR or not. As stated in another PR I'm currently redoing a lot of these GUI elements to use React instead as it's really a mess doing it this way. Thanks for the PR anyway.

@jamesmulcahy
Copy link
Copy Markdown
Contributor Author

OK, understood -- will hold off on other fixes/tweaks in this area!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants