Feature #674

Add support for requesting device state change

Added by Hammel 2 months ago. Updated about 1 month ago.

Status:ClosedStart date:02 Sep 2018
Priority:ImmediateDue date:
Assignee:Hammel% Done:

100%

Category:Software
Target version:Iron Man - 002 - MVP
Severity:01 - Critical

Description

This is the monitor->iot comm issue.

The monitor must query the deviceSet() function in the iot device.

The iot device must return new state data.

The monitor must update the iot's state data.


Related issues

Related to Jarvis - Feature #673: Add support for requesting device state change Closed 02 Sep 2018

Associated revisions

Revision 4be9b4a5
Added by Hammel about 1 month ago

RM #674: Add generalized genConfig() so it can be called from multiple locations to get current configuration as return data.

Revision 8c46243f
Added by Hammel about 1 month ago

RM #674: Implement support for accepting a device state change and issuing it to the specified device.

Revision 8c46243f
Added by Hammel about 1 month ago

RM #674: Implement support for accepting a device state change and issuing it to the specified device.

History

#1 Updated by Hammel 2 months ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10
  • Severity changed from 03 - Medium to 01 - Critical

This is the /set API for the sensor. It will work similar to /query in the IoT device. But it also sets the device state. The API returns 200 on success or 401 if the request can't be verified. On success the sensor sends back it's updated configuration data which the monitor will use to replace the old data (just like with getDevices).

The monitor does not iterate over all paired devices. It must know which one it wants to contact. This is handled by having the API use POST /set/device with the uuid encrypted in the JSON body.

#2 Updated by Hammel 2 months ago

  • % Done changed from 10 to 20

Code for monitor and IoT are written but not tested.

Easiest way to test this is to add the Jarvis command. See RM #673.

#3 Updated by Hammel about 1 month ago

  • % Done changed from 20 to 30

Jarvis command is ready. Now I can do a full integration test.

#4 Updated by Hammel about 1 month ago

  • Status changed from In Progress to Closed
  • % Done changed from 30 to 100

Wow. That was surprisingly close to perfect on the first try. After minor adjustments, the code in imrest and in the IoT device code (imlightsw) now properly handles the device state change requests. All over AES encrypted channels. Very cool.

All updates to Jarvis, imrest and imlightsw have been tested on real hardware (the LED goes on and off now on voice command!), committed and pushed upstream.

Closing issue.

Also available in: Atom PDF