Add support for getting device state.
|Status:||Closed||Start date:||15 Aug 2018|
|Target version:||Iron Man - 002 - MVP|
|Severity:||02 - High|
This is a command like: "Are the lights on in the office?"
This causes a command to be sent to imrest that causes it to retrieve state data from the "office" lightsw. The return values is the state value which Jarvis must "read out loud."This requires changes to:
- Jarvis: send command and speak response
- imrest: accept command and query correct device - this probably needs to be a generic format that can be easily forwarded to the correct device.
The command is synchronous, that is, the request to imrest will not complete until the request by imrest to lightsw responds. There may need to be timeouts set on this, however.
This command must be used to verify that the response from the device node can be properly deciphered by imrest, which must translate it into a response to Jarvis.
#1 Updated by Hammel about 1 year ago
- % Done changed from 0 to 10
- from the voice command, identify the description: "office"
- Find that description from monitor configurations.
- Use that monitor address to search the current device list.
- "Say" the state of each device that matches the device name: "light switch". This may need to count the number of matching devices or something instead of saying it for each device.
So there is no need to query the monitor for this information because we always have an updated view of the devices due to the TimerTask running in Jarvis now.
#2 Updated by Hammel about 1 year ago
- Status changed from New to Closed
- % Done changed from 10 to 100
This is now implemented and was tested while fixing RM #671. When you ask for "jarvis office states" you get back the number of devices in the office and how many are enabled and disabled. There is probably room for improvement here (I haven't verified what happens when you ask "Jarvis are the lights on in the office?", eg) but this is good enough for now.
Tested, committed and pushed.