clean.js
/*
 * Initiates a clean of the selected rooms
 */
Initiates a clean of the selected rooms
Initiates a clean of the selected rooms
function cleanSelectedRooms() {
	let container = document.getElementById('clean-rooms-container');
	let selected = container.querySelectorAll('input[type=checkbox]:checked');
	let rooms = [...selected].map(each => {
		return {
			region_id: each.getAttribute('data-region-id'),
			region_type: each.getAttribute('data-region-type'),
			region_name: each.labels[0].textContent
		};
	});
	let params = {
		command: 'start',
		initiator: 'rmtApp',
		time: Math.round((new Date()).getTime()/1000),
		ordered: 0,
		pmap_id: pmap_id,
		regions: rooms,
		user_pmapv_id: user_pmapv_id
	};
	document.getElementById('clean-start-button').disabled = true;
	roomba.on('mission', function (data) {
		console.log(data);
	});
	roomba.cleanRoom(params)
	.then(() => console.log('cleaning'))
	.catch(logger.logError);
}
function cleanSelectedRooms ( ) { let container = document . getElementById ( 'clean-rooms-container' ) ; let selected = container . querySelectorAll ( 'input[type=checkbox]:checked' ) ; let rooms = [ ... selected ] . map ( each => { return { region_id : each . getAttribute ( 'data-region-id' ) , region_type : each . getAttribute ( 'data-region-type' ) , region_name : each . labels [ 0 ] . textContent } ; } ) ; let params = { command : 'start' , initiator : 'rmtApp' , time : Math . round ( ( new Date ( ) ) . getTime ( ) / 1000 ) , ordered : 0 , pmap_id : pmap_id , regions : rooms , user_pmapv_id : user_pmapv_id } ; document . getElementById ( 'clean-start-button' ) . disabled = true ; roomba . on ( 'mission' , function ( data ) { console . log ( data ) ; } ) ; roomba . cleanRoom ( params ) . then ( ( ) => console . log ( 'cleaning' ) ) . catch ( logger . logError ) ; }
Initiates a clean of the selected rooms
Initiates a clean of the selected rooms