-
Notifications
You must be signed in to change notification settings - Fork 608
HomeAssistant@MatthewGodding - v1.0.0: New applet #7916
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
base: master
Are you sure you want to change the base?
Conversation
|
|
||
| // Request helper: use curl via GLib.spawn_command_line_sync and return | ||
| // callback(err, parsedResponseOrBody) | ||
| _request: function(method, path, body, callback) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a library called Soup in gi that can handle requests. Should be examples in other applets that use imports.gi.Soup, might save rolling your own implementation.
|
I like this idea. Tested it and it works. Nice! My 2 cents on this as I'd like to see it working and in mainline:
|
| this._state = null; | ||
|
|
||
| // Network session removed: use curl fallback only (works reliably | ||
| // across environments). Any libsoup-specific code was removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libsoup is a dependency of Cinnamon, shouldn't be any concern here
Thanks! Yes, agree with these points. Will need to think about the best approach for multiple entities, would it be multiple buttons, a list to select from etc? From a home assistant perspective you could use a scene or automation to switch multiple things. It would also be nice in the future to give the Home Assistant URL and token then pull back a list of devices and entities to select from. |
This new applet switches https://www.home-assistant.io/ entities such as lights. I personally have found this useful to quickly switch my hue play monitor light on and off. I plan to expand with more features however I've been using it for a few weeks and have found no issues so wish to publish to a larger audience.