diff options
Diffstat (limited to 'src/Diller.js')
-rw-r--r-- | src/Diller.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/Diller.js b/src/Diller.js index 46dc8e2..dc4c5e7 100644 --- a/src/Diller.js +++ b/src/Diller.js @@ -21,13 +21,13 @@ function Diller(config, pg, dao) { function newName(dao, device, property, timestamp, name) { log.info('New name for property ', device.key + '/' + property.key + '.name = ' + name); - return dao.updatePropertyName(property.id, name); + return dao.updateProperty(property.id, {name: name}); } function newDescription(dao, device, property, timestamp, description) { log.info('New description for property ', device.key + '/' + property.key + '.description = ' + description); - return dao.updatePropertyDescription(property.id, description); + return dao.updateProperty(property.id, {description: description}); } function updateAggregates(propertyId, timestamp) { @@ -54,6 +54,14 @@ function Diller(config, pg, dao) { return dao.updateDevice(deviceId, attributes); } + function updatePropertyAttributes(propertyId, attributes) { + var x = _.clone(attributes); + x.propertyId = propertyId; + log.info('Updating property attributes', x); + + return dao.updateProperty(propertyId, attributes); + } + //noinspection JSUnusedLocalSymbols function onMessage(topic, message, payload) { var timestamp = new Date(); @@ -121,7 +129,8 @@ function Diller(config, pg, dao) { return { onMessage: onMessage, - updateDeviceAttributes: updateDeviceAttributes + updateDeviceAttributes: updateDeviceAttributes, + updatePropertyAttributes: updatePropertyAttributes } } |