Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Light.yaml custom mappings #18

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

botastic
Copy link

@botastic botastic commented Jul 16, 2024

Thank you for taking the time to work on a Pull Request. Your contribution is really appreciated! 🎉
Please don't delete any part of the template, since keeping the provided structure will help maintainers to review your work more rapidly.

Sections marked as * are required and need to be filled in.

Breaking change

If your PR contains a breaking change for existing users, it is important to describe what breaks, how to make it work again and why we did this. This section will be used to craft the changelog entry, after your PR gets approved and merged.

Note: Remove this section if this PR is NOT a breaking change.

Proposed change*

Hey,
I recently wanted to change the mapping for one of my lights. Unfortunately, that currently requires me to change the lights.yaml and adjusting/merging it every time I want to update the blueprint. So I did what any sane person would do and spent hours creating a prototype :D

How it works:

  • create a folder next to the lights.yaml blueprint called ahb_custom_mappings
  • add a file to it e.g. ikea_e1524_1.yaml
  • the content could like this (switching brightness and color buttons):
brightness_up: button_right_short 
brightness_down: button_left_short
color_down: button_down_short
color_up: button_up_short
toggle: button_center_short
  • in the blueprint use ikea_e1524_1 as the Controller Mapping

so the file structure for my branch would look something like this:
blueprints/automation/botastic/ahb_tmp/

└── blueprints
    └── automation
        └── botastic
            ├── light.yaml
            └── ahb_custom_mappings
                └── ikea_e1524_1.yaml

I did not update the documentation yet, because I wanted to first see if you'd be interested in this feature.

Also the ikea_e1524_1.yaml file is currently listed as a blueprint with an error. So far, I have not been able to fix this. Personally, it doesn't bother me, but it might be irritating to others. This could be fixed by moving the ahb_custom_mappings to a different location, e.g. blueprints/ahb_custom_mappings , and adjusting the include path accordingly (../../ahb_custom_mappings ). Not sure whether this would be against any convention.

Cheers

Checklist*

  • I followed sections of the Contribution Guidelines relevant to changes I'm proposing.
  • I properly tested proposed changes on my system and confirm that they are working as expected.
  • I formatted files with Prettier using the command npm run format before submitting my Pull Request.

@LewisSpring LewisSpring added enhancement New feature or request Hook labels Aug 13, 2024
@LewisSpring
Copy link
Collaborator

Hi @botastic
As per #19, please accept my apologies for the delay.

For this one I am slightly reticent as it increases complexity for the gain of few users.
It's a great idea and a clever implementation (your yaml/template skills are better than mine!) but for mainstream users I think the new "Take Control" feature would be better suited this use case where a few mappings need to be switched around.

I am ignoring the scene selection as that is now in #19, I am happy to treat that separately.

Please let me know your thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Hook
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants