GroupFactory
Summary
Defines a factory to manage groups.
Item Index
Methods
addDevices
Syntax
addDevices
-
devices
Summary
Adds devices to their respecting group.
It uses the group property of each device
Parameters:
-
devices
ArrayThe list of devices
addDeviceToGroup
Syntax
addDeviceToGroup
-
device
-
groupId
Summary
Adds a device to a group.
addGroup
Syntax
addGroup
-
group
Summary
Adds a new group.
Parameters:
-
group
ObjectThe new group description object
addHistoric
Syntax
addHistoric
-
id
-
historic
Summary
Adds a group historic.
addSchedule
Syntax
addSchedule
-
id
-
schedule
Summary
Adds a group schedule.
getDeviceFromGroup
Syntax
Summary
Gets a device from a group.
Returns:
The device or null if not found
getGroup
Syntax
Summary
Gets a group by its id.
It implies that the list of groups has been retrieved from server using GroupFactory.getGroups().
Parameters:
-
id
StringThe group id
Returns:
The group or null if not found
getGroups
Syntax
Summary
Gets all groups of devices from server.
Returns:
A promise resolving with the list of groups
isValidSchedule
Syntax
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.
Returns:
The error if validation failed, null otherwise
removeDeviceFromGroup
Syntax
removeDeviceFromGroup
-
device
-
groupId
Summary
Removes a device from a group.
removeHistoric
Syntax
removeHistoric
-
id
-
historicId
Summary
Removes a group historic.
removeHistory
Syntax
removeHistory
-
id
Summary
Removes a device's history.
Parameters:
-
id
StringThe device id
removeSchedule
Syntax
removeSchedule
-
groupId
-
scheduleId
Summary
Removes a group schedule.
setGroupsProperty
Syntax
setGroupsProperty
-
property
-
value
Summary
Sets a property on all groups.
Parameters:
-
property
StringThe name of the property to set
-
value
MixedThe value for the property
setProperty
Syntax
setProperty
-
id
-
property
-
value
Summary
Updates a group property.
updateStatus
Syntax
updateStatus
-
groupId
Summary
Updates status of a group regarding the status of its devices.
Parameters:
-
groupId
StringThe group id