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
Add Scenes option to oh-repeater component #1721
Comments
I looked a bit into the topic because I found it tempting to have a list of scenes that could be switched on and off. What would be possible of course to a new source named "rules" that loads these rules (and I did a proof of concept on that and that works) but they would be processed as items which, I think, is not a clean approach even if added a new component for example "oh-list-rule", for example. maybe @ghys could give some hints in what direction this could be developed in a clean way. |
Thanks for looking into this @stefan-hoehn 👍 |
This is exactly what I implemented in my POC but as I mentioned the whole concept is around managing items in widgets or repeaters and not something else like things or rules. |
Don't understand your comment.
|
Yes, similar to the above code is what I wanted to achieve:
Thanks for insisting on it 😄 This is now what I did: I extended the repeater code to add a new source
And it does create a list which is based on the rules that have been loaded. I debugged and I could see within the repeater that each element is a rule and you have directed my into the right direction. I was looking for a component that would allow me to access the properties and I tried the oh-list-item (obviously incorrectly - see below) which didn't work and I could't find something suitable but the oh-button did then work with the following widget code based on your idea:
which in fact produces the following So, I went along, added the ruleTags property
and voila, we get and >drum role< it even works when you click on the entry. and I tried an oh-list-item and it works as well
and produces So, I think we can call this "success". Let's say what the maintainers say when I finally do a PR. |
Great you did not give up and found a solution 👍 |
fixes #1721 Add Scenes option to oh-repeater component This PR adds the possibility to iterate over a list of rules queried via a tag. For example it allows to create a list of Scenes via the oh-repeater by using the rulesTag = Scene and trigger the rule via a oh-button. Example ``` slots: default: - component: oh-list slots: default: - component: oh-repeater config: for: scene sourceType: rulesWithTags ruleTags: Scene slots: default: - component: oh-button config: action: rule actionRule: =loop.scene.uid text: =loop.scene.name ``` -- Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
The problem
The newly introduced scenes via scenes editor are only available within actions when creating custom widgets.
Your suggestion
It would be great to have the scenes available within the oh-repeater component, to create widgets with automatically generated scene lists.
The text was updated successfully, but these errors were encountered: