Wire automatic motion event lifecycle
This commit is contained in:
@@ -53,10 +53,10 @@ export const api = {
|
||||
end: (id) => request(`/streams/${id}/end`, { method: 'POST', body: JSON.stringify({ reason: 'completed' }) })
|
||||
},
|
||||
events: {
|
||||
startMotion: () =>
|
||||
startMotion: (payload = {}) =>
|
||||
request('/events/motion/start', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ title: 'Simulated Motion', triggeredBy: 'motion' })
|
||||
body: JSON.stringify({ title: 'Simulated Motion', triggeredBy: 'motion', ...payload })
|
||||
}),
|
||||
endMotion: (id) => request(`/events/${id}/motion/end`, { method: 'POST', body: JSON.stringify({ status: 'completed' }) }),
|
||||
finalizeRecording: (id, payload) => request(`/recordings/${id}/finalize`, { method: 'POST', body: JSON.stringify(payload) })
|
||||
|
||||
Reference in New Issue
Block a user