2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-25 16:05:19 +00:00

contrib/AutomowerConnect: Common.pm changes for some mower with no capability for work areas but calendar task data sets have workAreaId=0 by default

git-svn-id: https://svn.fhem.de/fhem/trunk@28844 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Ellert 2024-05-06 21:58:33 +00:00
parent 71dc78daed
commit 8630f406f4
2 changed files with 50 additions and 23 deletions

View File

@ -25,7 +25,7 @@
################################################################################ ################################################################################
package FHEM::Devices::AMConnect::Common; package FHEM::Devices::AMConnect::Common;
my $cvsid = '$Id: Common.pm 28823b 2024-04-26 13:14:53Z Ellert $'; my $cvsid = '$Id: Common.pm 28823c 2024-04-26 13:14:53Z Ellert $';
use strict; use strict;
use warnings; use warnings;
use POSIX; use POSIX;
@ -1207,7 +1207,7 @@ sub Set {
my $calendarjson = eval { my $calendarjson = eval {
require JSON::PP; require JSON::PP;
my %ORDER=(start=>1,duration=>2,monday=>3,tuesday=>4,wednesday=>5,thursday=>6,friday=>7,saturday=>8,sunday=>9); my %ORDER=(start=>1,duration=>2,monday=>3,tuesday=>4,wednesday=>5,thursday=>6,friday=>7,saturday=>8,sunday=>9,workAreaId=>10);
JSON::PP->new->sort_by( JSON::PP->new->sort_by(
sub {($ORDER{$JSON::PP::a} // 999) <=> ($ORDER{$JSON::PP::b} // 999) or $JSON::PP::a cmp $JSON::PP::b}) sub {($ORDER{$JSON::PP::a} // 999) <=> ($ORDER{$JSON::PP::b} // 999) or $JSON::PP::a cmp $JSON::PP::b})
->pretty(1)->utf8( not $unicodeEncoding )->encode( $hash->{helper}{mower}{attributes}{calendar}{tasks} ) ->pretty(1)->utf8( not $unicodeEncoding )->encode( $hash->{helper}{mower}{attributes}{calendar}{tasks} )
@ -1289,7 +1289,7 @@ sub Set {
return "$iam decode error: $@ \n $setVal" if ($@); return "$iam decode error: $@ \n $setVal" if ($@);
$calendarjson = eval { $calendarjson = eval {
require JSON::PP; require JSON::PP;
my %ORDER=(start=>1,duration=>2,monday=>3,tuesday=>4,wednesday=>5,thursday=>6,friday=>7,saturday=>8,sunday=>9); my %ORDER=(start=>1,duration=>2,monday=>3,tuesday=>4,wednesday=>5,thursday=>6,friday=>7,saturday=>8,sunday=>9,workAreaId=>10);
JSON::PP->new->sort_by( JSON::PP->new->sort_by(
sub {($ORDER{$JSON::PP::a} // 999) <=> ($ORDER{$JSON::PP::b} // 999) or $JSON::PP::a cmp $JSON::PP::b}) sub {($ORDER{$JSON::PP::a} // 999) <=> ($ORDER{$JSON::PP::b} // 999) or $JSON::PP::a cmp $JSON::PP::b})
->pretty(1)->utf8( not $unicodeEncoding )->encode( $calendarjson ) ->pretty(1)->utf8( not $unicodeEncoding )->encode( $calendarjson )
@ -1801,7 +1801,7 @@ sub Attr {
$attrVal = eval { $attrVal = eval {
require JSON::PP; require JSON::PP;
my %ORDER=(start=>1,duration=>2,monday=>3,tuesday=>4,wednesday=>5,thursday=>6,friday=>7,saturday=>8,sunday=>9); my %ORDER=(start=>1,duration=>2,monday=>3,tuesday=>4,wednesday=>5,thursday=>6,friday=>7,saturday=>8,sunday=>9,workAreaId=>10);
JSON::PP->new->sort_by( JSON::PP->new->sort_by(
sub {($ORDER{$JSON::PP::a} // 999) <=> ($ORDER{$JSON::PP::b} // 999) or $JSON::PP::a cmp $JSON::PP::b}) sub {($ORDER{$JSON::PP::a} // 999) <=> ($ORDER{$JSON::PP::b} // 999) or $JSON::PP::a cmp $JSON::PP::b})
->pretty(1)->encode( $perl ) ->pretty(1)->encode( $perl )
@ -2908,7 +2908,7 @@ sub getDefaultScheduleAsJSON {
my $hash = $defs{$name}; my $hash = $defs{$name};
my $json = eval { my $json = eval {
require JSON::PP; require JSON::PP;
my %ORDER=(start=>1,duration=>2,monday=>3,tuesday=>4,wednesday=>5,thursday=>6,friday=>7,saturday=>8,sunday=>9); my %ORDER=(start=>1,duration=>2,monday=>3,tuesday=>4,wednesday=>5,thursday=>6,friday=>7,saturday=>8,sunday=>9,workAreaId=>10);
JSON::PP->new->sort_by( JSON::PP->new->sort_by(
sub {($ORDER{$JSON::PP::a} // 999) <=> ($ORDER{$JSON::PP::b} // 999) or $JSON::PP::a cmp $JSON::PP::b}) sub {($ORDER{$JSON::PP::a} // 999) <=> ($ORDER{$JSON::PP::b} // 999) or $JSON::PP::a cmp $JSON::PP::b})
->utf8( not $unicodeEncoding )->encode( $hash->{helper}{mower}{attributes}{calendar}{tasks} ) ->utf8( not $unicodeEncoding )->encode( $hash->{helper}{mower}{attributes}{calendar}{tasks} )

View File

@ -1,6 +1,6 @@
if ( !(typeof FW_version === 'undefined') ) if ( !(typeof FW_version === 'undefined') )
FW_version["automowerconnect.js"] = "$Id: automowerconnect.js 28823a 2024-04-26 13:14:53Z Ellert $"; FW_version["automowerconnect.js"] = "$Id: automowerconnect.js 28823c 2024-04-26 13:14:53Z Ellert $";
{ window.onload = ( ()=>{ { window.onload = ( ()=>{
let room = document.querySelector("#content"); let room = document.querySelector("#content");
@ -481,13 +481,20 @@ function AutomowerConnectPanelCmd ( panelcmd ) {
FW_cmd( FW_root+"?cmd="+panelcmd+"&XHR=1" ); FW_cmd( FW_root+"?cmd="+panelcmd+"&XHR=1" );
} }
function AutomowerConnectHandleInput ( dev ) { function AutomowerConnectHandleInput ( dev, hasWorkAreaId, workAreaId ) {
let cal = JSON.parse( document.querySelector( '#amc_'+dev+'_schedule_div' ).getAttribute( 'data-amc_schedule' ) ); let cal = JSON.parse( document.querySelector( '#amc_'+dev+'_schedule_div' ).getAttribute( 'data-amc_schedule' ) );
let cali = document.querySelector('#amc_'+dev+'_index').value || cal.length; let cali = document.querySelector('#amc_'+dev+'_index').value || cal.length;
if ( cali > cal.length ) cali = cal.length; if ( cali > cal.length ) cali = cal.length;
if ( cali > 13 ) cali = 13; if ( cali > 13 ) cali = 13;
for (let i=cal.length;i<=cali;i++) { cal.push( { "start":0, "duration":1439, "monday":false, "tuesday":false, "wednesday":false, "thursday":false, "friday":false, "saturday":false, "sunday":false } ) } for (let i=cal.length;i<=cali;i++) {
if ( hasWorkAreaId ) {
cal.push( { "start":0, "duration":1439, "monday":false, "tuesday":false, "wednesday":false, "thursday":false, "friday":false, "saturday":false, "sunday":false, "workAreaId":workAreaId } )
} else {
cal.push( { "start":0, "duration":1439, "monday":false, "tuesday":false, "wednesday":false, "thursday":false, "friday":false, "saturday":false, "sunday":false } )
}
}
//~ console.log('cali: '+cali+' cal.length: '+cal.length); //~ console.log('cali: '+cali+' cal.length: '+cal.length);
let elements = ["start", "duration"]; let elements = ["start", "duration"];
@ -498,7 +505,7 @@ function AutomowerConnectHandleInput ( dev ) {
if ( isNaN( hour ) && item == "start" ) hour = 0; if ( isNaN( hour ) && item == "start" ) hour = 0;
if ( isNaN( min ) && item == "start" ) min = 0; if ( isNaN( min ) && item == "start" ) min = 0;
if ( isNaN( hour ) && item == "duration" ) hour = 23; if ( isNaN( hour ) && item == "duration" ) hour = 23*60;
if ( isNaN( min ) && item == "duration" ) min = 59; if ( isNaN( min ) && item == "duration" ) min = 59;
cal[cali][item] = hour + min; cal[cali][item] = hour + min;
@ -547,7 +554,11 @@ function AutomowerConnectHandleInput ( dev ) {
if ( cali > cal.length -1 ) cali = cal.length -1; if ( cali > cal.length -1 ) cali = cal.length -1;
if ( !cal[cali] ) { if ( !cal[cali] ) {
cal = [ { "start":0, "duration":1440, "monday":true, "tuesday":true, "wednesday":true, "thursday":true, "friday":true, "saturday":true, "sunday":true } ]; if ( hasWorkAreaId ) {
cal = [ { "start":0, "duration":1440, "monday":true, "tuesday":true, "wednesday":true, "thursday":true, "friday":true, "saturday":true, "sunday":true, "workAreaId":workAreaId } ];
} else {
cal = [ { "start":0, "duration":1440, "monday":true, "tuesday":true, "wednesday":true, "thursday":true, "friday":true, "saturday":true, "sunday":true } ];
}
cali = 0; cali = 0;
} }
@ -557,8 +568,11 @@ function AutomowerConnectHandleInput ( dev ) {
shdl += "<style>"; shdl += "<style>";
shdl += ".amc_schedule_tabth{margin:auto; width:50%; text-align:left;}"; shdl += ".amc_schedule_tabth{margin:auto; width:50%; text-align:left;}";
shdl += "</style>"; shdl += "</style>";
shdl += "<table id='amc_"+dev+"_schedule_table0' class='amc_schedule_table col_bg block wide' ><tbody>"; shdl += "<table id='amc_"+dev+"_schedule_table0' class='amc_schedule_table col_bg block wide'><thead>";
//~ if ( hasWorkAreaId ) shdl += "<td><input id='amc_"+dev+"_workareaid' type='number' value='"+workAreaId+"' readonly /></td>";
if ( hasWorkAreaId ) shdl += "<tr class='even amc_schedule_tabth' ><th colspan='100%' >Calendar for Work Area Id: "+workAreaId+"</th></tr>";
shdl += "<tr class='even amc_schedule_tabth' ><th>Index</th><th>Start</th><th>Duration</th><th>Mon.</th><th>Tue.</th><th>Wed.</th><th>Thu.</th><th>Fri.</th><th>Sat.</th><th>Sun.</th><th></th></tr>"; shdl += "<tr class='even amc_schedule_tabth' ><th>Index</th><th>Start</th><th>Duration</th><th>Mon.</th><th>Tue.</th><th>Wed.</th><th>Thu.</th><th>Fri.</th><th>Sat.</th><th>Sun.</th><th></th></tr>";
shdl += "</thead><tbody>";
shdl += "<tr class='even'>"; shdl += "<tr class='even'>";
shdl += "<td><input id='amc_"+dev+"_index' type='number' value='"+cali+"' min='0' max='13' step='1' size='3' /></td>"; shdl += "<td><input id='amc_"+dev+"_index' type='number' value='"+cali+"' min='0' max='13' step='1' size='3' /></td>";
shdl += "<td><input id='amc_"+dev+"_start' type='time' value='"+("0"+parseInt(cal[cali].start/60)).slice(-2)+":"+("0"+cal[cali].start%60).slice(-2)+"' /></td>"; shdl += "<td><input id='amc_"+dev+"_start' type='time' value='"+("0"+parseInt(cal[cali].start/60)).slice(-2)+":"+("0"+cal[cali].start%60).slice(-2)+"' /></td>";
@ -570,7 +584,7 @@ function AutomowerConnectHandleInput ( dev ) {
shdl += "<td><input id='amc_"+dev+"_friday' type='checkbox' "+(cal[cali].friday?"checked='checked'":"")+" /></td>"; shdl += "<td><input id='amc_"+dev+"_friday' type='checkbox' "+(cal[cali].friday?"checked='checked'":"")+" /></td>";
shdl += "<td><input id='amc_"+dev+"_saturday' type='checkbox' "+(cal[cali].saturday?"checked='checked'":"")+" /></td>"; shdl += "<td><input id='amc_"+dev+"_saturday' type='checkbox' "+(cal[cali].saturday?"checked='checked'":"")+" /></td>";
shdl += "<td><input id='amc_"+dev+"_sunday' type='checkbox' "+(cal[cali].sunday?"checked='checked'":"")+" /></td>"; shdl += "<td><input id='amc_"+dev+"_sunday' type='checkbox' "+(cal[cali].sunday?"checked='checked'":"")+" /></td>";
shdl += "<td><button id='amc_"+dev+"_schedule_button_plus' title='add: prepare a data set and click &plusmn;&#013;delete: unckeck each weekday and click &plusmn;&#013;reset: fill any time field with -- and click &plusmn;' onclick=' AutomowerConnectHandleInput ( \""+dev+"\" )' style='padding-bottom:4px; font-weight:bold; font-size:16pt; ' >&ensp;&plusmn;&ensp;</button></td>"; shdl += "<td><button id='amc_"+dev+"_schedule_button_plus' title='add: prepare a data set and click &plusmn;&#013;delete: unckeck each weekday and click &plusmn;&#013;reset: fill any time field with -- and click &plusmn;' onclick=' AutomowerConnectHandleInput ( \""+dev+"\", \""+hasWorkAreaId+"\", \""+workAreaId+"\" )' style='padding-bottom:4px; font-weight:bold; font-size:16pt; ' >&ensp;&plusmn;&ensp;</button></td>";
shdl += "</tr><tr style='border-bottom:1px solid black'><td colspan='100%'></td></tr>"; shdl += "</tr><tr style='border-bottom:1px solid black'><td colspan='100%'></td></tr>";
for (let i=0; i< cal.length; i++){ for (let i=0; i< cal.length; i++){
@ -584,13 +598,15 @@ function AutomowerConnectHandleInput ( dev ) {
shdl += "<td>&thinsp;"+(cal[i].thursday?"&#x2611;":"&#x2610;")+"</td>"; shdl += "<td>&thinsp;"+(cal[i].thursday?"&#x2611;":"&#x2610;")+"</td>";
shdl += "<td>&thinsp;"+(cal[i].friday?"&#x2611;":"&#x2610;")+"</td>"; shdl += "<td>&thinsp;"+(cal[i].friday?"&#x2611;":"&#x2610;")+"</td>";
shdl += "<td>&thinsp;"+(cal[i].saturday?"&#x2611;":"&#x2610;")+"</td>"; shdl += "<td>&thinsp;"+(cal[i].saturday?"&#x2611;":"&#x2610;")+"</td>";
shdl += "<td>&thinsp;"+(cal[i].sunday?"&#x2611;":"&#x2610;")+"</td><td></td>"; shdl += "<td>&thinsp;"+(cal[i].sunday?"&#x2611;":"&#x2610;")+"</td>";
if ( hasWorkAreaId ) shdl += "<td>&thinsp;"+workAreaId+"</td>";
shdl += "<td></td>";
shdl += "</tr>"; shdl += "</tr>";
} }
shdl += "<tr>"; shdl += "<tr>";
let nrows = cal.length*11+2; let nrows = cal.length*(hasWorkAreaId?12:11)+2;
shdl += "<td colspan='12' ><textarea style='font-size:10pt; ' readOnly wrap='off' cols='62' rows='"+(nrows > 35 ? 35 : nrows)+"'>"+JSON.stringify(cal,null," ")+"</textarea></td>"; shdl += "<td colspan='12' ><textarea style='font-size:10pt; width:98%; ' readOnly wrap='off' cols='62' rows='"+(nrows > (3*(hasWorkAreaId?12:11)+2) ? (3*(hasWorkAreaId?12:11)+2) : nrows)+"'>"+JSON.stringify(cal,null," ")+"</textarea></td>";
shdl += "</tr>"; shdl += "</tr>";
shdl += "</tbody></table>"; shdl += "</tbody></table>";
shdl += "</div>"; shdl += "</div>";
@ -606,17 +622,27 @@ function AutomowerConnectSchedule ( dev ) {
let el = document.getElementById('amc_'+dev+'_schedule_div'); let el = document.getElementById('amc_'+dev+'_schedule_div');
if ( el ) el.remove(); if ( el ) el.remove();
let hasWorkAreaId = false;
let workAreaId = null;
FW_cmd( FW_root+"?cmd={ FHEM::Devices::AMConnect::Common::getDefaultScheduleAsJSON( \""+dev+"\" ) }&XHR=1",( cal ) => { FW_cmd( FW_root+"?cmd={ FHEM::Devices::AMConnect::Common::getDefaultScheduleAsJSON( \""+dev+"\" ) }&XHR=1",( cal ) => {
cal = JSON.parse( cal ); cal = JSON.parse( cal );
if (cal.length == 0) cal = [ { "start":0, "duration":1440, "monday":true, "tuesday":true, "wednesday":true, "thursday":true, "friday":true, "saturday":true, "sunday":true } ]; if ( cal.length == 0 ) cal = [ { "start":0, "duration":1440, "monday":true, "tuesday":true, "wednesday":true, "thursday":true, "friday":true, "saturday":true, "sunday":true } ];
if ( cal[0].workAreaId != null ) {
hasWorkAreaId = true;
workAreaId = cal[0].workAreaId
}
let cali = 0; let cali = 0;
let shdl = "<div id='amc_"+dev+"_schedule_div' data-amc_schedule='"+JSON.stringify(cal)+"' title='Schedule editor' class='col_fg'>"; let shdl = "<div id='amc_"+dev+"_schedule_div' data-amc_schedule='"+JSON.stringify(cal)+"' title='Schedule editor' class='col_fg'>";
shdl += "<style>"; shdl += "<style>";
shdl += ".amc_schedule_tabth{text-align:left;}"; shdl += ".amc_schedule_tabth{text-align:left;}";
shdl += "</style>"; shdl += "</style>";
shdl += "<table id='amc_"+dev+"_schedule_table0' class='amc_schedule_table col_bg block wide'><tbody>"; shdl += "<table id='amc_"+dev+"_schedule_table0' class='amc_schedule_table col_bg block wide'><thead>";
shdl += "<tr class='even amc_schedule_tabth ' ><th>Index</th><th>Start</th><th>Duration</th><th>Mon.</th><th>Tue.</th><th>Wed.</th><th>Thu.</th><th>Fri.</th><th>Sat.</th><th>Sun.</td><th></th></tr>"; //~ if ( hasWorkAreaId ) shdl += "<td><input id='amc_"+dev+"_workareaid' type='number' value='"+workAreaId+"' readonly /></td>";
if ( hasWorkAreaId ) shdl += "<tr class='even amc_schedule_tabth' ><th colspan='100%' >Calendar for Work Area Id: "+workAreaId+"</th></tr>";
shdl += "<tr class='even amc_schedule_tabth' ><th>Index</th><th>Start</th><th>Duration</th><th>Mon.</th><th>Tue.</th><th>Wed.</th><th>Thu.</th><th>Fri.</th><th>Sat.</th><th>Sun.</th><th></th></tr>";
shdl += "</thead><tbody>";
shdl += "<tr class='even'>"; shdl += "<tr class='even'>";
shdl += "<td><input id='amc_"+dev+"_index' type='number' value='"+cali+"' min='0' max='13' step='1' size='3' /></td>"; shdl += "<td><input id='amc_"+dev+"_index' type='number' value='"+cali+"' min='0' max='13' step='1' size='3' /></td>";
shdl += "<td><input id='amc_"+dev+"_start' type='time' value='"+("0"+parseInt(cal[cali].start/60)).slice(-2)+":"+("0"+cal[cali].start%60).slice(-2)+"' /></td>"; shdl += "<td><input id='amc_"+dev+"_start' type='time' value='"+("0"+parseInt(cal[cali].start/60)).slice(-2)+":"+("0"+cal[cali].start%60).slice(-2)+"' /></td>";
@ -628,7 +654,7 @@ function AutomowerConnectSchedule ( dev ) {
shdl += "<td><input id='amc_"+dev+"_friday' type='checkbox' "+(cal[cali].friday?"checked='checked'":"")+" /></td>"; shdl += "<td><input id='amc_"+dev+"_friday' type='checkbox' "+(cal[cali].friday?"checked='checked'":"")+" /></td>";
shdl += "<td><input id='amc_"+dev+"_saturday' type='checkbox' "+(cal[cali].saturday?"checked='checked'":"")+" /></td>"; shdl += "<td><input id='amc_"+dev+"_saturday' type='checkbox' "+(cal[cali].saturday?"checked='checked'":"")+" /></td>";
shdl += "<td><input id='amc_"+dev+"_sunday' type='checkbox' "+(cal[cali].sunday?"checked='checked'":"")+" /></td>"; shdl += "<td><input id='amc_"+dev+"_sunday' type='checkbox' "+(cal[cali].sunday?"checked='checked'":"")+" /></td>";
shdl += "<td><button id='amc_"+dev+"_schedule_button_plus' title='add: prepare a data set and click &plusmn;&#013;delete: unckeck each weekday and click &plusmn;&#013;reset: fill any time field with -- and click &plusmn;' onclick='AutomowerConnectHandleInput ( \""+dev+"\" )' style='padding-bottom:4px; font-weight:bold; font-size:16pt; ' >&ensp;&plusmn;&ensp;</button></td>"; shdl += "<td><button id='amc_"+dev+"_schedule_button_plus' title='add: prepare a data set and click &plusmn;&#013;delete: unckeck each weekday and click &plusmn;&#013;reset: fill any time field with -- and click &plusmn;' onclick='AutomowerConnectHandleInput ( \""+dev+"\", \""+hasWorkAreaId+"\", \""+workAreaId+"\" )' style='padding-bottom:4px; font-weight:bold; font-size:16pt; ' >&ensp;&plusmn;&ensp;</button></td>";
shdl += "</tr><tr style='border-bottom:1px solid black'><td colspan='100%'></td></tr>"; shdl += "</tr><tr style='border-bottom:1px solid black'><td colspan='100%'></td></tr>";
for (let i=0; i< cal.length; i++){ for (let i=0; i< cal.length; i++){
@ -642,18 +668,19 @@ function AutomowerConnectSchedule ( dev ) {
shdl += "<td>&thinsp;"+(cal[i].thursday?"&#x2611;":"&#x2610;")+"</td>"; shdl += "<td>&thinsp;"+(cal[i].thursday?"&#x2611;":"&#x2610;")+"</td>";
shdl += "<td>&thinsp;"+(cal[i].friday?"&#x2611;":"&#x2610;")+"</td>"; shdl += "<td>&thinsp;"+(cal[i].friday?"&#x2611;":"&#x2610;")+"</td>";
shdl += "<td>&thinsp;"+(cal[i].saturday?"&#x2611;":"&#x2610;")+"</td>"; shdl += "<td>&thinsp;"+(cal[i].saturday?"&#x2611;":"&#x2610;")+"</td>";
shdl += "<td>&thinsp;"+(cal[i].sunday?"&#x2611;":"&#x2610;")+"</td><td></td>"; shdl += "<td>&thinsp;"+(cal[i].sunday?"&#x2611;":"&#x2610;")+"</td>";
shdl += "<td></td>";
shdl += "</tr>"; shdl += "</tr>";
} }
shdl += "<tr>"; shdl += "<tr>";
let nrows = cal.length*11+2; let nrows = cal.length*(hasWorkAreaId?12:11)+2;
shdl += "<td colspan='12' ><textarea style='font-size:10pt; ' readOnly wrap='off' cols='62' rows='"+(nrows > 35 ? 35 : nrows)+"'>"+JSON.stringify(cal,null," ")+"</textarea></td>"; shdl += "<td colspan='12' ><textarea style='font-size:10pt; width:98%; ' readOnly wrap='off' cols='62' rows='"+(nrows > (3*(hasWorkAreaId?12:11)+2) ? (3*(hasWorkAreaId?12:11)+2) : nrows)+"'>"+JSON.stringify(cal,null," ")+"</textarea></td>";
shdl += "</tr>"; shdl += "</tr>";
shdl += "</tbody></table>"; shdl += "</tbody></table>";
shdl += "</div>"; shdl += "</div>";
let schedule = new DOMParser().parseFromString( shdl, "text/html" ).querySelector( '#amc_'+dev+'_schedule_div' ); let schedule = new DOMParser().parseFromString( shdl, "text/html" ).querySelector( '#amc_'+dev+'_schedule_div' );
document.querySelector('body').append( schedule ); document.querySelector('body').append( schedule );
document.querySelector( "#amc_"+dev+"_schedule_button_plus" ).setAttribute( "onclick", "AutomowerConnectHandleInput( '"+dev+"' )" ); document.querySelector( "#amc_"+dev+"_schedule_button_plus" ).setAttribute( "onclick", "AutomowerConnectHandleInput( '"+dev+"', '"+hasWorkAreaId+"', '"+workAreaId+"' )" );
$(schedule).dialog({ $(schedule).dialog({
dialogClass:"no-close", modal:true, width:"auto", closeOnEscape:true, dialogClass:"no-close", modal:true, width:"auto", closeOnEscape:true,