-
Notifications
You must be signed in to change notification settings - Fork 4
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
New config format #7
Comments
Is there a list, what issues exist with the existing format?
Am 27.10.2017 22:25 schrieb "uwap" <notifications@github.com>:
We should design a new config format which is cleaner
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#7>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAvaC0EhTmA1Lp4EcKIHTfDZKQML6mW9ks5swjw0gaJpZM4QJkwK>
.
|
it is clumsy. especially it will get more clumsy when I change a bit about the ui part. I guess I should first make the changes before thinking about how to clean up the config format. |
We should definely change
to
or even to
A further idea would be to also add a
it would also allow to mix different icon sets:
Edit:
|
Additionally to the icons being weird in the config format, I think that the topics section is weird too. I think it is not great that First of all, I want to provide a new way to describe message types.
I want it to be like:
Possible types would be string, number, json and date. For the array part I need to brainstorm a bit more about possible ideas. cc @Bfritz0815 @Ranlvor |
I like to rewrite icon colors. Right now it is always a function. I don't like it. Instead, I want it to be either a color newtype or a javascript object or a function. Examples:
Maybe default should be always required or maybe the map should do a check if all possible values are covered. Last but not least only for complex setups it should be possible to use a function:
|
Maybe flows $Keys type could be used to force the use of all values for colors if default is not given: |
We should make the This could result in this for example:
|
I always thought the internal representation of values was kind of redundant and unintuitive but sadly I couldn't find a way around that. Now that I'm looking at the topic types again I really think I've found a way. Originally the parseState function was only a way around the lack of representations in the config format. But we could actually use it to emulate the internal representation thing. The best example is the The only problem with this representation now is that |
I also thought about the
|
In the very beginning of this project, we had actions. Each UI control would trigger an action. The action itself would then do something on certain topics. This seemed redundant to me, so we removed it really quickly. Especially since it had some flaws. A slider, mutating values, and a toggle button could in no way share the same actions. But the way we defined actions had no way of preventing it. We need to reinvent actions in a non redundant way. One slider for example could easily modify multiple values, for example when changing the brightness of a lighting group. A toggle button could toggle multiple things at once. It should be even possible to have it toggle between two of many options. |
One way I can think of this is expanding the For example an old way of defining a button could look like this:
A new way could look like this:
This already has multiple drawbacks:
|
The slider is a more interesting topic though. If a slider changes a light group consisting out of 3 light bulbs, each with their own mqtt topic, which one sets the actual light brightness / the state for this component? |
Another thing that should be possible is having a slider controlling the light for example. When the slider is turned down to 0 is should be able to send "OFF", when it is turned higher than 0 it should sent "ON", but only once. I want the new actions to capable of doing so. |
I thought about it. Maybe we can do something like this:
This, but with a more elegant API would be a valid way to describe actions, I think. |
With the config being essential close to JSON, the syntax seems increadibly bloaty. While actions might be a solution to increase the complexity of what we can express and might have the change to express this in a short and eloquent manner, it would be nice to have a custom syntax.
I could imagine something like this instead of the current entropia config. There might be a way to parse custom javascript syntax using Babel. We could then transform it to javascript. The only issue here would be the flow type checker, as it's important that it runs through AFTER transforming the custom syntax into javascript. |
We should design a new config format which is cleaner.
Open questions:
The text was updated successfully, but these errors were encountered: