OpenVeo Manage AngularJS back end

API Docs for: 1.0.0-alpha.0
Show:

GroupFactory

Summary

Defines a factory to manage groups.

Methods

addDevices

Syntax

addDevices

(
  • devices
)

Summary

Adds devices to their respecting group.

It uses the group property of each device

Parameters:

  • devices Array

    The list of devices

addDeviceToGroup

Syntax

addDeviceToGroup

(
  • device
  • groupId
)

Summary

Adds a device to a group.

Parameters:

  • device Object

    The device to add to the group

  • groupId String

    The id of the group

addGroup

Syntax

addGroup

(
  • group
)

Summary

Adds a new group.

Parameters:

  • group Object

    The new group description object

addHistoric

Syntax

addHistoric

(
  • id
  • historic
)

Summary

Adds a group historic.

Parameters:

addSchedule

Syntax

addSchedule

(
  • id
  • schedule
)

Summary

Adds a group schedule.

Parameters:

getDeviceFromGroup

Syntax

getDeviceFromGroup

(
  • deviceId
  • groupId
)
Object | Null

Summary

Gets a device from a group.

Parameters:

  • deviceId String

    The id of the device

  • groupId String

    The id of the group

Returns:

Object | Null:

The device or null if not found

getGroup

Syntax

getGroup

(
  • id
)
Object | Null

Summary

Gets a group by its id.

It implies that the list of groups has been retrieved from server using GroupFactory.getGroups().

Parameters:

Returns:

Object | Null:

The group or null if not found

getGroups

Syntax

getGroups

() Promise

Summary

Gets all groups of devices from server.

Returns:

Promise:

A promise resolving with the list of groups

isValidSchedule

Syntax

isValidSchedule

(
  • id
  • schedule
)
Error | Null

Summary

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

Group's schedule should not be in collision with devices' schedule inside the group.

Parameters:

  • id String

    The group id

  • schedule Object

    The schedule to validate

Returns:

Error | Null:

The error if validation failed, null otherwise

removeDeviceFromGroup

Syntax

removeDeviceFromGroup

(
  • device
  • groupId
)

Summary

Removes a device from a group.

Parameters:

  • device Object

    The device to remove

  • groupId String

    The group id

removeGroup

Syntax

removeGroup

(
  • id
)

Summary

Removes a group.

Parameters:

removeHistoric

Syntax

removeHistoric

(
  • id
  • historicId
)

Summary

Removes a group historic.

Parameters:

removeHistory

Syntax

removeHistory

(
  • id
)

Summary

Removes a device's history.

Parameters:

removeSchedule

Syntax

removeSchedule

(
  • groupId
  • scheduleId
)

Summary

Removes a group schedule.

Parameters:

  • groupId String

    The group id

  • scheduleId String

    The schedule id

setGroupsProperty

Syntax

setGroupsProperty

(
  • property
  • value
)

Summary

Sets a property on all groups.

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 group property.

Parameters:

  • id String

    The group id

  • property String

    The property to modify

  • value Mixed

    The property value

updateStatus

Syntax

updateStatus

(
  • groupId
)

Summary

Updates status of a group regarding the status of its devices.

Parameters:

validatePreset

Syntax

validatePreset

(
  • groupId
  • presetId
)

Summary

Validates a preset confronting group's devices' available inputs.

If one of the devices has invalid inputs regarding the preset, preset is considered invalid.

Parameters: