frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Proposal for a new scene editor

Open karwosts opened this issue 1 year ago • 12 comments

Proposed change

A change to the current behavior of the scene editor is currently one of the most-voted requested features, and I spent a little time thinking about an alternative behavior that might be more user friendly and less surprising. I came up with the following:

In this proposal scenes are no longer activated simply because the scene editor is opened. Instead of yoking the config in the scene editor to the live status of all the devices in the scene, add a "capture" button for each device/entity that allows user to copy the current state of that device only into their scene. This allows decoupling the current state from the scene being edited.

By using this behavior, scene can be partially edited without having to take live the state of all other devices in the scene, and user can pick and choose which to update. Capture button also serves as an indicator that the current state of the device is not equal to the state saved in the scene.

This also adds an "Activate" button to the overflow menu, in case user wants to choose to activate the full scene.

As a possible enhancement, because the scene config state is decoupled from the live state, this would allow for adding a yaml editor here to allow for fine tweaking the scene state in yaml (similar to how automations elements can be edited in ui or yaml). But that has not been implemented yet.

Hasn't been tested that extensively yet, but just wanted to get an idea of if the UI might be something we would want to go for.

image

Type of change

  • [ ] Dependency upgrade
  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [x] New feature (thank you!)
  • [ ] Breaking change (fix/feature causing existing functionality to break)
  • [ ] Code quality improvements to existing code or addition of tests

Example configuration


Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion: https://community.home-assistant.io/t/improve-scene-editor-allow-scene-edits-without-setting-devices-states/151053
  • Link to documentation pull request:

Checklist

  • [x] The code change is tested and works locally.
  • [x] There is no commented out code in this PR.
  • [ ] Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

Summary by CodeRabbit

  • New Features
    • Enhanced scene management capabilities in the HaSceneEditor, allowing users to capture and manage changes to scene entities.
    • Introduced a feature to capture all dirty entities with a streamlined UI.
  • Improvements
    • Improved state management for unsaved changes, ensuring more responsive user interactions.
    • Updated localization with new strings for better clarity in the editor's functionality.

karwosts avatar Mar 15 '24 14:03 karwosts