The method getDeviceSync() is called by the server hub to retrieve the current state of all subscribed attributes as well as device name and label for a device that is local to the hub running the Remote Client.
| Function |
getDeviceSync |
| Purpose |
Retrieves the current attribute and device name/label. |
| Parameters |
None |
| URL Format |
/device/:deviceId/sync/:type |
| HTTP Method |
GET - Incoming |
| HTTP Parameters |
| Name |
Type |
Description |
| deviceId |
Integer |
The ID of the physical device (from the sharing hub). |
| type |
String |
The groupname from the NATIVE_DEVICES driver definition map. (i.e. "switches", etc.) |
|
| Return JSON |
|
Name
|
Type |
Return Values |
| status |
String |
"success" or "error" on failure. If failure, no other parameters will be returned. |
| name |
String |
Current device name. (device.name) |
| label |
String |
Current device label. (device.label) |
currentValues
|
List |
List of objects containing the current value of each attribute.
| Name |
Description |
| name |
Attribute name. (i.e. "switch", "level", etc) |
| value |
Current value of the attribute as reported by the physical device. (i.e. "on", "100", etc.) |
| unit |
Optional unit of measurement. (i.e. "v" for voltage) |
|
|