DeviceEvent Provider
- Copyright:
- Kiwigrid GmbH 2014-2015
- Source:
Classes
Members
-
<inner, constant> CREATED
-
Type for created event.
- Source:
Example
angular.module('exampleApp', ['keta.services.DeviceEvent']) .controller('ExampleController', function(ketaDeviceEvent) { if (type === ketaDeviceEvent.CREATED) { // ... } });
-
<inner, constant> DELETED
-
Type for deleted event.
- Source:
Example
angular.module('exampleApp', ['keta.services.DeviceEvent']) .controller('ExampleController', function(ketaDeviceEvent) { if (type === ketaDeviceEvent.DELETED) { // ... } });
-
<inner, constant> UPDATED
-
Type for updated event.
- Source:
Example
angular.module('exampleApp', ['keta.services.DeviceEvent']) .controller('ExampleController', function(ketaDeviceEvent) { if (type === ketaDeviceEvent.UPDATED) { // ... } });
Methods
- <inner> create(type, device) → {DeviceEventInstance}
- <inner> getDevice() → {DeviceInstance}
- <inner> getType() → {string}
-
<inner> create(type, device) → {DeviceEventInstance}
-
Creates a DeviceEventInstance with given type and Device instance.
Parameters:
Name Type Description type
string DeviceEvent type device
DeviceInstance Device instance - Source:
Returns:
DeviceEventInstance DeviceEventInstance createdExample
angular.module('exampleApp', ['keta.services.Device', 'keta.services.DeviceEvent']) .controller('ExampleController', function(ketaDevice, ketaDeviceEvent) { var device = ketaDevice.create(eventBus, { tagValues: { IdName: { name: 'IdName', value: 'Device', oca: 0, timestamp: 123456789 } } }); var deviceEvent = ketaDeviceEvent.create(DeviceEvent.TYPE_CREATED, device); });
-
<inner> getDevice() → {DeviceInstance}
-
Returns device of DeviceEvent.
- Source:
Returns:
DeviceInstance deviceExample
angular.module('exampleApp', ['keta.services.Device', 'keta.services.DeviceEvent']) .controller('ExampleController', function(ketaDevice, ketaDeviceEvent) { var device = ketaDevice.create({ guid: 'guid' }); var deviceEvent = ketaDeviceEvent.create(ketaDeviceEvent.TYPE_CREATED, device); var deviceEventDevice = deviceEvent.getDevice(); });
-
<inner> getType() → {string}
-
Returns type of DeviceEvent.
- Source:
Returns:
string typeExample
angular.module('exampleApp', ['keta.services.Device', 'keta.services.DeviceEvent']) .controller('ExampleController', function(ketaDevice, ketaDeviceEvent) { var device = ketaDevice.create({ guid: 'guid' }); var deviceEvent = ketaDeviceEvent.create(ketaDeviceEvent.TYPE_CREATED, device); var deviceEventType = deviceEvent.getType(); });