aboutsummaryrefslogtreecommitdiff
path: root/web/static/app/DillerRpc.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/static/app/DillerRpc.js')
-rw-r--r--web/static/app/DillerRpc.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/web/static/app/DillerRpc.js b/web/static/app/DillerRpc.js
index b1939f4..f865dc5 100644
--- a/web/static/app/DillerRpc.js
+++ b/web/static/app/DillerRpc.js
@@ -33,11 +33,21 @@ function DillerRpc($http, DillerConfig) {
return $http(req);
}
+ function patchProperty(propertyId, payload) {
+ var req = {};
+ req.method = 'patch';
+ req.url = baseUrl + '/api/property/:propertyId/values';
+ req.url = req.url.replace(/:propertyId/, propertyId);
+ req.data = payload;
+ return $http(req);
+ }
+
return {
getDevices: getDevices,
getDevice: getDevice,
patchDevice: patchDevice,
- getValues: getValues
+ getValues: getValues,
+ patchProperty: patchProperty
};
}
@@ -54,3 +64,6 @@ DillerRpcResolve.patchDevice = function(DillerRpc, $route) {
DillerRpcResolve.getValues = function(DillerRpc, $route) {
return DillerRpc.getValues($route.current.params.propertyId);
};
+DillerRpcResolve.patchProperty = function(DillerRpc, $route) {
+ return DillerRpc.patchProperty($route.current.params.propertyId, $route.current.params.payload);
+};