Ok! I’ve looked at that, it’s cool to see how intuitively you’ve developed it. It makes me think that before we start working as a group, I absolutely must write some guidelines so that we have the same processes for developing new routes
I’m not talking about the code style, which is already enforced by ESLint, but about development methods.
An example:
I see that to change the route to the edit route, you created a function « Edit »:
edit(state, scene) {
const name = scene.name.replace(/[^A-Z0-9]/ig, '_').toLowerCase();
store.setState({
sceneEditing: scene
});
route(`/dashboard/scene/edit/${name}`);
},
We should avoid this, because if we access the route directly by entering the URL, the state won’t be present! Here a <Link> is sufficient.
By the way, the GET route /scene will probably only return a list of scenes with just the name, the id, and the selector. It’s the edit view that, when it loads, will fetch the entire scene!
No worries As I was saying, everything in the architecture of the current Preact project is not yet clear in my head either, I’m still experimenting on some subjects! We are still very far from being in the « industrial development » phase on Gladys 4, it’s still a lot of experience on my side.
I just integrated your design, it’s cool it looks good →
By the way, I added a « Trigger » tab to manage the list of triggers. My opinion on this is that it’s clearly something separate from the scenes, since it’s also a whole complexity.
We will have to think about how we model the trigger + the conditions.
For the scene editing view, for now I prefer the one I made, after that I agree we can work to reduce the space each action takes.
To go back to the subject of the Philips Hue service, I finished a first very rough version of this service (on the server side at least, the interface is not yet 100% functional).
An interesting function of this service is the light.turnOn function.
I tried to do something as simple as possible, and by giving the service the minimum to do.
I deliberately did not do the entire gladys-hue service, as I am still experimenting, if we find things to change I prefer to have to modify only a few functions rather than the entire API
I will continue to think about other « classic » services, in order to get my hands on it and see if this implementation makes sense!
Feel free to give me your feedback before I start the implementation
The other topic is managing the polling of certain types of devices.
Let me explain.
Some devices like Philips Hue have methods to refresh the state of the bulbs, in case the state was changed outside of Gladys, for example via a switch.
Until now, it was the module that managed the polling.
Now, it’s integrated into Gladys.
Each device has 2 attributes: « should_poll » and « poll_frequency », and Gladys will automatically periodically request the service via a « poll » method to ask it to update the state of a given device.
No surprise, it confirms people’s interest in home automation in 2019.
Xiaomi, Bluetooth devices, Sonoff, Z-Wave, and Yeelight are the hardware most sought after. No surprise given the excellent quality/price ratio of Xiaomi’s home automation offering.
On the issues specific to Gladys, HTTPS, Docker, and MQTT are at the top. No surprise, it confirms my ambition to simplify these three points in Gladys 4.
On the software integration side, no surprise with Snips, Spotify, Alexa, and Telegram.
Well, I just created a fairly exhaustive list of the remaining tasks to be done before having a first minimal functional version of the Gladys 4 backend.
Personal reasons but he’s fine, and no you didn’t miss an episode ^^
No idea! But I’d say a few months given the latest news
I saw your list @pierre-gilles, so I received the 40 or so emails this morning
But why in each route do you put v1? Are you planning to version the APIs?
If you want, I can do a few things to save you time! Just tell me what you want me to do. For example, I noticed that the drawer doesn’t work on mobile, I can fix that?
Anyway, I can do small things like that while you properly define the guidelines?
Another thing, I built the V1 branch of tabler and I realized that the entire template was redone from scratch and a lot of things have changed! So I wonder if it wouldn’t be better to start from this version even if it’s not yet fully complete rather than having to redo most of the work in two or three months when they finally release V1?
Yes! The API is versioned. If we start to have mobile apps, external services that depend on it, we can’t afford to break the API. So if we ever change the response format of an API, we keep the v1 route, and we create a v2, simple as that
Mm the drawer I’d say don’t bother, it works on the gateway, I just need to take back the code that does that :slight_smile
However, I would appreciate help with frontend questions, like the other day with the scene view, it really helped Since we’re not really ready in terms of frontend guidelines, don’t bother too much with the code, just some small design tips would help me a lot, CSS is my weak point ^^
A few ideas:
1/ For the chat view, I struggled to recreate a chat and I’m not very satisfied with the result because the chat bubbles are not proportional to the text size. I think we just need to take back the CSS from Gladys 3 which was great (maybe adding the avatars, since in Gladys 4 a user will have an avatar + Gladys now has a logo!).
2/ If you see a way to reduce the size of the « scene editing » view. I agree that it’s too big right now. After that, I want to keep clarity and ease of use, it needs to stay airy!
3/ I haven’t thought about the « trigger editing » view at all
Oh damn, the CSS changed completely?
We need to evaluate when they plan to release. I’m not necessarily for switching to the v1 branch if they are still actively working on it, the current version is more than enough for what we do! After all, if they release v1 in 2 weeks, okay ^^
The backend v0.1 milestone is progressing well, we’re at 54% of tasks completed. I added a few todos along the way, but I think once all the tasks are done we’ll already have a minimal backend that does the job.
Feel free to check it out and criticize some naming choices, or parameters passed to API routes, as nothing has been released yet we can still change everything. It’s always cool to have outside opinions
Scripts in Gladys 4
I have a small question for you regarding scripts in Gladys 4.
In terms of interface, I was wondering if it was worth having a separate script tab from scenes.
Couldn’t a script in Gladys 4 just be an action in a scene that says « execute this piece of JS code »?
The Pros
Designing a complex scene is easier, you can code pieces of code that chain sequentially/parallelly in the same UI from the same scene, without having to jump between the scene/script UI
Give less importance in the UI to scripts in a product that addresses an audience not always dev (while keeping them of course for power users!). Is reserving an entire tab for scripts useful? Not sure…
Better integration with scenes. Example: Passing a value from a trigger to a scene and finding the value in the script.
The Cons
May bring complexity to the scene UI which must incorporate a code editor (which is heavy)
Large scripts may lose readability (I don’t necessarily have an idea yet on how to code these scripts in the scene view)
Tell me your opinion on the question, it’s a debate nothing is set in stone yet!
I agree with you except when you just want to run it alone manually to test something quickly, it’s still convenient to have it in a separate list.
We’ll see if the same thing is possible in the scene section…
Indeed! The goal of the script editor in Gladys is that it is comprehensive enough to be able to code properly in it…
That’s the goal!
Gladys 4 is a complete rewrite, there is no common code between the two codebases. It’s a completely new product Given the changes, it will necessarily be a reinstallation (we are completely changing the technology and deployment process). However, we will probably provide a migration tool to recover some data
To be seen, what data we want to transfer from V3 to V4. Not everything is worth keeping, and we don’t want it to create mysterious bugs due to poorly formatted data from V3.
It’s the same for scenes! That’s the purpose of scenes, you can click on « play » and it plays the scene.