OpenVeo Manage AngularJS back end

API Docs for: 1.0.0-alpha.0
Show:

ManageDeviceFactory

Summary

Defines a factory to manage devices.

Devices are categorized by state. Either "accepted", "refused", "pending" or "incoming". An "incoming" device is a newly connected device manifesting after retrieving the list of known devices from the server. A "pending" device is a connected device not in server's list of known devices.

Methods

addDevice

Syntax

addDevice

(
  • device
  • state
)

Summary

Adds a new device to the manage interface as a connected device.

Parameters:

  • device Object

    The new device description object

  • state String

    The device state

addHistoric

Syntax

addHistoric

(
  • id
  • historic
)

Summary

Adds a device historic.

Parameters:

addSchedule

Syntax

addSchedule

(
  • id
  • schedule
)

Summary

Adds a device schedule.

Parameters:

getDevice

Syntax

getDevice

(
  • id
)
Object | Null

Summary

Retrieves a device by its id.

Search is made on all devices, accepted, pending, refused and incoming devices.

Parameters:

Returns:

Object | Null:

The device or null if not found

getDevices

Syntax

getDevices

() Promise

Summary

Gets all devices from server.

Returns:

Promise:

A promise resolving with the list of devices categorized by state (either "pending", "accepted" or "refused")

getDevicesByState

Syntax

getDevicesByState

(
  • state
)
Array

Summary

Gets devices corresponding to the given state.

Parameters:

  • state String

    The state to look for

Returns:

Array:

The list of devices

isGroupSchedulesCollision

Syntax

isGroupSchedulesCollision

(
  • id
  • group
)
Boolean

Summary

Checks if there are collisions between device's schedules and group's schedules.

Parameters:

Returns:

Boolean:

true if there is at least one collision, false otherwise

isValidSchedule

Syntax

isValidSchedule

(
  • id
  • schedule
  • [group]
)
Error | Null

Summary

Checks if a schedule is not in collision with other schedules.

Device schedule should not be in collision with device's group schedules if inside the group.

Parameters:

  • id String

    The device id

  • schedule Object

    The schedule to validate

  • [group] Object optional

    The device's group

Returns:

Error | Null:

The error if validation failed, null otherwise

remove

Syntax

remove

(
  • id
)
Object

Summary

Removes a device.

Parameters:

Returns:

Object:

The removed device

removeHistoric

Syntax

removeHistoric

(
  • id
  • historicId
)

Summary

Removes a device historic.

Parameters:

removeHistory

Syntax

removeHistory

(
  • id
)

Summary

Removes a device's history.

Parameters:

removeSchedule

Syntax

removeSchedule

(
  • id
  • scheduleId
)

Summary

Removes a device's schedule.

Parameters:

setDevicesProperty

Syntax

setDevicesProperty

(
  • property
  • value
)

Summary

Sets a property on all devices.

Parameters:

  • property String

    The name of the property to set

  • value Mixed

    The value for the property

setProperty

Syntax

setProperty

(
  • id
  • property
  • value
)

Summary

Updates a device's property.

Parameters:

  • id String

    The device id

  • property String

    The property to modify

  • value Mixed

    The property value

updateDeviceState

Syntax

updateDeviceState

(
  • id
  • newState
)

Summary

Updates a device's state.

Parameters:

  • id String

    The updated device id

  • newState String

    The new state of the device

updateDeviceStatusMessage

Syntax

updateDeviceStatusMessage

(
  • id
)
private

Summary

Updates device's status message depending on its actual status. Device's status message is a human readable explanation about the device's status.

Parameters:

validatePreset

Syntax

validatePreset

(
  • deviceId
  • presetId
)

Summary

Validates a device preset confronting its available inputs. Inputs error is available in device.inputs property.

Parameters:

  • deviceId String

    The device id

  • presetId String

    The device preset id