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:
spaceId(required): The space ID of the device.deviceId(required): The device ID.
InstaVision.deviceServices.getCloudSettings(
spaceId = "spaceId",
deviceId = "deviceId",
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:
spaceId(required): The space ID of the device.deviceId(required): The device ID.request(required): The request object containing the AI cloud settings to be updated.
val request = AiSettingsRequest(cloudAi = AiDetection(motion = true))
InstaVision.deviceServices.updateAiSettings(
spaceId = "spaceId",
deviceId = "deviceId",
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:
spaceId(required): The space ID of the device.deviceId(required): The device ID.request(required): The request object containing the notification cloud settings to be updated.
val request = Notification(mute = !status)
InstaVision.deviceServices.updateNotificationSettings(
spaceId = "spaceId",
deviceId = "deviceId",
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:
spaceId(required): The space ID of the device.deviceId(required): The device ID.isEnabled(required): A boolean value indicating whether motion detection should be enabled or disabled.
InstaVision.deviceServices.updateMotionDetection(
spaceId = "spaceId",
deviceId = "deviceId",
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
},
)