Endpoints
Properties
| (integer) count |
|---|
| The count property gets the number of endpoints that a device has |
| Examples |
| devices = env.facility.devices; mydevices = devices.toArray() mydevices.forEach((dev)=> { totalEndpoints = dev.endpoints.count env.log(totalEndpoints) }); |
| (integer) deviceID |
|---|
| The deviceID property gets the unique device identifier to which an endpoint belongs |
| Examples |
| let devices = env.facility.devices; let mydevices = devices.toArray() mydevices.forEach((dev)=> { let deviceId = dev.endpoints.deviceID env.log(deviceId) }); |
| (integer) facilityID |
|---|
| The facilityID property gets the unique facility identifier to which an endpoint belongs |
| Examples |
| let devices = env.facility.devices; let mydevices = devices.toArray() mydevices.forEach((dev)=> { let facilityId = dev.endpoints.facilityID env.log(facilityId) }); |
Methods
| (object) byTag(string tag) |
|---|
| The byTag method gets an endpoint object given a specific tag, for more information see endpoint |
| Examples |
| let endpoints = env.facility.endpoints; let myendPoint = endpoints.byTag("My test endpoint tag") env.log(myendPoint) |
| (object[]) allByTag(string tag) |
|---|
| The allByTag method gets all endpoint objects as an array that have a specific tag, for more information see endpoint |
| Examples |
| let endpoints = env.facility.endpoints; let myendPoints = endpoints.allByTag("Head office endpoint") env.log(myendPoints) |
| (object) byType(EndpointType type) |
|---|
| The byType method gets an endpoint object given an endpoint type, for more information about endpoint types see this page |
| Examples |
| let endpoints = env.facility.endpoints; let myendPoint = endpoints.byType(endpointType.locationTracker) env.log(myendPoint) |
| (object) byType(EndpointType type EndPointSubType subtype) |
|---|
| The byType method gets an endpoint object given an endpoint type and subtype, for more information about endpoint types and subtypes see this page |
| Examples |
| let endpoints = env.facility.endpoints; let myendPoint = endpoints.byType(endpointType.appliance, applianceEndpointSubType.lamp) env.log(myendPoint) |
| (object[]) AllByType(EndpointType type) |
|---|
| The AllByType method gets all endpoint objects given an endpoint type, for more information about endpoint types and subtypes see this page |
| Examples |
| let endpoints = env.facility.endpoints; let myendPointsArrray = endpoints.AllByType(endpointType.appliance, applianceEndpointSubType.lamp) env.log(myendPointsArray) |
| (object[]) AllByType(EndpointType type EndPointSubType subtype) |
|---|
| The AllByType method gets all endpoint objects as an array that match a given endpoint type and subtype, for more information about endpoint types and subtypes see this page |
| Examples |
| let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.AllByType(endpointType.appliance, applianceEndpointSubType.lamp) env.log(myendPointsArray) |
| (object) ByAddress(string endpointaddress) |
|---|
| The ByAddress method gets an endpoint object given its address, for more information see this page |
| Examples |
| let endpoints = env.facility.endpoints; let myendPoint = endpoints.byAddress('16785349') env.log(myendPoint) |
| (object) byIndex(integer index) |
|---|
| The byIndex method gets an existing endpoint object in the facility given its index where zero is the first element, for more information see this page |
| Examples |
| let endpoints = env.facility.endpoints; let myendPoint = endpoints.byIndex(0); env.log(myendPoint) |
| object[] toArray() |
|---|
| The toArray() method gets all existing endpoint objects in the facility as an array, for more information see this page |
| Examples |
| let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); env.log(myendPointsArray) |