Google smart home command for blinds - actions-on-google

I would like to control blinds using google smart home action. How can I create commands like "turn/put my blind up/down" ? What device traits should I use? It seems OnOff trait doesn't understand up and down, can I custom it? Thanks!

You could use the undocumented (use at your own risk) device type: action.devices.types.BLINDS.
Instead you could use for traits:
On/Off: action.devices.traits.OnOff
Brightness: action.devices.traits.Brightness
In this way, you can ask Google to set a specific position, to close (in Italian it works as a turn off command, in English, I did not try yet), to turn on or to turn off. The open command instead seems to be not recognized as a turn on command.
Hope to help you and hope that Google releases soon types and traits for blinds/curtain control.
EDIT as pointed out by #robin-thoni is not documented: https://developers.google.com/actions/smarthome/guides/blinds

Related

Drag and Drop Behavior on Chrome DevTools Protocol

I am trying to write a tool that open's a website and interacts with and triggers the drag/drop behavior. I am seeing Input.dragIntercepted, Input.dispatchDragEvent functions in the documentation. But when I use these functions, I am getting a ... is not a function error. Probably, I am not using them in a proper way.
How can I use these functions to trigger drag and drop behavior of the web application? I did not find any example that shows usage of these functions.
First of all, Input.dragIntercepted really isn't a function. It's an event that will be fired, but only if you enable it, using Input.setInterceptDrags with enable set as true.
This is documented both here and here.

Opening the VSC settings window from code

I'm working on a Visual Studio Code extension, where some settings are required for it to work properly. Right now, in case the user has forgotten something, I'm showing a warning message indicating this, and telling them to fix this property in the settings. I would, however, like to add a button that opens the settings page of that property.
However, after looking around for over an hour, I can't seem to find any support for this in the Api, or anyone else asking this question (which I find a bit weird?). If it really doesn't exist, I'd still expect at least 1 other person asking this somewhere, but as far as I can see there's absolutely nothing.
Is it possible to open the settings window (preferably even filtering them down to only my extension's properties/the one property that has to be filled in) from code?
Thanks in advance
I found it out myself after digging through the keybinds window. You can use the following to open the settings:
vscode.commands.executeCommand("workbench.action.openSettings2");
I did not, however, find how to pass a search query into it to open a specific place in the settings.
EDIT: You can use openSettings & add the search query as an extra argument to executeCommand. For example - if your property is defined as my.extension.property in package.json, you can use this:
vscode.commands.executeCommand("workbench.action.openSettings", "my.extension.property");

Remove Invocation Requirement for Alpha Released Google Home Action

Can a private, alpha released, action remove the need to use the phrase "talk to [my app]" in invocation?
For example, is it possible to invoke the action by saying:
"Ok Google, tell me my agenda." Automatically invoking the private action.
In contrast to, "Hey Google, tell My App to tell me my agenda."
Implicit invocation seemed promising, but further research made me think it was just a way for Google to suggest your app to a user. Am I mistaken in this interpretation?
Implicit invocation is a feature, similar to built-in intents to invoke an action directly without the talk to my app prefix. These features should work for public as well as alpha release actions.
I don't know if agenda specifically will be supported, as that is something that can be handled directly by the Google Assistant, but a query like play a game will suggest your alpha released action.

MVVM Light : How to remove dependency of System.Windows.MessageBoxResult from DialogMessage

I'm working on a MVVM application, using MVVM Light and on the whole I'm finding it very nice to work with. I have a nagging issue however and hope someone can help.
I'm using sending instances of DialogMessage from VM to the View to display dialogs. The result is sent back to my VM via a callback, all good so far.
However the result of the dialog (OK, Yes, No, Cancel etc) is sent back as a member of the enum System.Windows.MessageBoxResult. This seems to go against the View/ViewModel separation to me, MessageBoxResult is clearly a type from the UI and so the VM shouldn't be dependent upon this or anything from the System.Windows namespace.
What I'm looking for is someway of using DialogMessage with an alternative callback eg Action<UserResult>; rather than Action<System.Windows.MessageBoxResult>;, where UserResult is a type defined by me to represent the users choice without dependency on MessageBoxResult.
Is this possible or am I being too strict in me desire to keep UI concepts out of the VM?
In regards to the second part of your question, when I started working with MVVM Light I too felt that receiving a MessageBoxResult back in the VM seems a little to UI-oriented.
On the other hand, if only the name was different - such as UserResult as you suggested - would that be sufficient for you?
If only the nameing of the class is a problem, I think you can let it slip. The result Ok, Yes, No, Cancel do not give an indication of whether a MessageBox was shown with buttons or whether it was some other kind of UI implementation (lets say a form with a combo box).
If it still bothers you, you can always create a wrapper for the DialogMessage which will raise the Dialog, get the MessageBoxResult and return a UserResult which can be an enum with the same values (think of it as a simple converter).
But as I said, I think it might be an overkill...

Is it possible to map a key press to simulate middle-click in xwindows?

I'm wondering, is it possible to somehow map a key-press event to act like a middle-key click of a mouse in Xwindows? They are diffrent devices, I know, but if there was a way to trigger a middle-button click event from a C program, it should be easy to bind a key to it using existing xwindows mechanisms.
Xevent does the trick:
http://www.isv.uu.se/~ziemann/xevent/
http://linuxgazette.net/153/misc/ziemann/xevent.c
The code compiles and runs just fine on my machine.
If you are interested as a developer: It uses the XTest extension, which is included in the X server. There is also some old, still valid documentation of that API online:
http://www.xfree86.org/current/xtestlib.html