Device Cloud Settings
Pre-requisite The user has to be signed in to perform the following operations.
Get Cloud settings for a device
To get the cloud settings for a device, The following method can be used:
device(required): The device object on which the operation has to be performed.
InstaVision.deviceServices.getCloudSettings(
device = device,
onSuccess = { cloudSetting ->
// The cloud settings object
},
onError = { error ->
// The error object contains the error code and message
},
)
Update AI cloud settings for a device
To update the AI cloud settings for a device, The following method can be used:
device(required): The device object on which the operation has to be performed.request(required): The request object containing the AI cloud settings to be updated.
val request = AiSettingsRequest(cloudAi = AiDetection(motion = true))
InstaVision.deviceServices.updateAiSettings(
device = device,
request = request,
onSuccess = {
// The cloud settings updated
},
onError = { error ->
// The error object contains the error code and message
},
)
Update Notification cloud Settings for a Device
To update the notification cloud settings for a device, The following method can be used:
device(required): The device object on which the operation has to be performed.request(required): The request object containing the notification cloud settings to be updated.
val request = Notification(mute = !status)
InstaVision.deviceServices.updateNotificationSettings(
device = device,
request = request,
onSuccess = {
// The notification settings updated
},
onError = { error ->
// The error object contains the error code and message
},
)
Get Activity Zones all the devices in a space
To get the activity zones for all the devices in a space, The following method can be used:
spaceId(required): The space ID of the devices.
InstaVision.deviceServices.getActivityZones(
spaceId = "spaceId",
onSuccess = { activityZones ->
// An object containing the activity zones for all devices in the space including cluster and non-cluster devices
},
onError = { error ->
// The error object contains the error code and message
},
)
Update Motion Detection Settings for a Device
To update the motion detection settings for a device, The following method can be used:
device(required): The device object on which the operation has to be performed.isEnabled(required): A boolean value indicating whether motion detection should be enabled or disabled.
InstaVision.deviceServices.updateMotionDetection(
device = device,
isEnabled = true, // Set to false to disable motion detection
onSuccess = {
// The motion detection settings have been updated successfully
},
onError = { error ->
// The error object contains the error code and message
},
)
Update Embargo Schedule for a Device
To update the embargo (do-not-disturb) schedule for a device, The following method can be used:
spaceId(required): The space ID of the device.deviceId(required): The ID of the device.request(required): The request object containing the embargo schedule to be updated.
val request = UpdateEmbargoScheduleRequest(
startTime = Time(hour = 22, minute = 0),
endTime = Time(hour = 6, minute = 0),
isActive = true,
)
InstaVision.deviceServices.updateEmbargoSchedule(
spaceId = "spaceId",
deviceId = "deviceId",
request = request,
onSuccess = { embargoSetting ->
// The updated embargo schedule object
},
onError = { error ->
// The error object contains the error code and message
},
)
Update Hunting Mode for a Device
To update the hunting mode for a device, The following method can be used:
spaceId(required): The space ID of the device.deviceId(required): The ID of the device.request(required): The request object containing the new hunting mode status.
val request = UpdateHuntingModeRequest(enabled = true)
InstaVision.deviceServices.updateHuntingMode(
spaceId = "spaceId",
deviceId = "deviceId",
request = request,
onSuccess = { huntingMode ->
// The updated hunting mode object
},
onError = { error ->
// The error object contains the error code and message
},
)