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

[Marketplace] Add support for transformations to be installed from the marketplace #4046

Closed
rkoshak opened this issue Jan 16, 2024 · 3 comments · Fixed by #4216
Closed

[Marketplace] Add support for transformations to be installed from the marketplace #4046

rkoshak opened this issue Jan 16, 2024 · 3 comments · Fixed by #4216
Assignees
Labels
enhancement An enhancement or new feature of the Core

Comments

@rkoshak
Copy link

rkoshak commented Jan 16, 2024

#The problem
I find myself reposting some of the same transformation scripts to the forum over and over (e.g. split a number into DD:HH:MM:SS, filter out changes that are too small, unit conversions not supported by UoM, etc.).

#Your suggestion
Add a new category to the marketplace to install transformations similar to the way that rule templates can be installed.

I don't think these need to support properties like a rule template because arguments can be passed to them when they are applied. But if it's a no brainer to support that I'm sure we'll find a use for it. :-D

Issue for MainUI is openhab/openhab-webui#2239 (comment)

@J-N-K
Copy link
Member

J-N-K commented May 19, 2024

Would something like that work for you? It gets installed with the UID from the YAML. Since that is just a string, one could also edit it to use a more "useful" name. The added transformation is not editable.

https://community.openhab.org/t/testtopic/156092

@rkoshak
Copy link
Author

rkoshak commented May 20, 2024

I think it's probably OK that the transform is not editable. Transforms are usually going to be short compared to a rule template so if it doesn't do what one wants, they can copy/paste/edit themselves.

The YAML looks good. Nice and simple.

When you say "edit it to use a more useful name" do you mean the author of the transformation can change that or that the end user can change it? Either is reasonable in my book, I just want clarification.

All transformation types are supported or only some? I really only expect to see Script transformations published but who knows what people will come up with. Maybe there's a hidden demand for Map transformations. So the type filed is the language of the transformation for sure based on that example, but if it's not a Script would I use "map"?

Thanks a bunch for working on this! I'm really looking forward to having this new feature!

@J-N-K
Copy link
Member

J-N-K commented May 20, 2024

That works for every transformation type, a MAP would look like this:

uid: config:map:aGermanMapForOpenClosedType
label: maptest
type: map
configuration:
  function: |-
    CLOSED=zu
    OPEN=offen
    NULL=undefiniert

Regarding the name: This uid is used excatly like it is in the YAML (or JSON, you can also use JSON). So the "developer" of the transformation can set it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants