- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
/L_sPhoneUI.lua
r20 r30 5 5 return 6 6 end 7 8 sPh_LAYOUT_PFX = 'https://download1.mios.com/L_sPhoneUI_layout' 9 g_is_remote = 0 7 10 8 11 function string:template(variables) 9 return (self:gsub('%%{(.-)}%%', function (key) return tostring(variables[key] or '') end)) 12 return (self:gsub('{%%(.-)%%}', function (key) return tostring(variables[key] or _G[key] or '') end)) 13 end 14 15 function flag(v) 16 if( v==nil or tonumber(v)==0 ) then 17 return '0' 18 end 19 return '1' 10 20 end 11 21 … … 18 28 luup.register_handler("lug_sPhoneRequest_action_js","sPhone_action_js") 19 29 20 luup.log (("L_sPhoneUI running version: %{version_branch}%.%{version_major}%.%{version_minor}%"):template(luup))21 22 local html_header = [[30 luup.log (("L_sPhoneUI running version: {%version_branch%}.{%version_major%}.{%version_minor%}"):template(luup)) 31 32 local html_header = ([[ 23 33 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 24 34 <html xmlns="http://www.w3.org/1999/xhtml"> … … 27 37 <meta http-equiv="pragma" content="nocache"/> 28 38 <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"/> 29 <script src=" /port_3480/L_sPhoneUI_layout/js/mobile.js" language="javascript"></script>30 <link rel="stylesheet" href=" /port_3480/L_sPhoneUI_layout/css/iui.css" type="text/css" />39 <script src="{%sPh_LAYOUT_PFX%}/js/mobile.js" language="javascript"></script> 40 <link rel="stylesheet" href="{%sPh_LAYOUT_PFX%}/css/iui.css" type="text/css" /> 31 41 </head> 32 <body onLoad="js_prepare_urls(); ">33 ]] 42 <body onLoad="js_prepare_urls();set_layout_prefix('{%sPh_LAYOUT_PFX%}');"> 43 ]]):template ({}) 34 44 35 45 local html_footer=[[ … … 37 47 </html>]] 38 48 39 function list_devices (lul_room, out )49 function list_devices (lul_room, out, lul_js) 40 50 41 51 local grouphead_inserted = false … … 48 58 end 49 59 50 if( v.category_num==2 ) then -- DEVICE_CATEGORY_DIMMABLE_LIGHT60 if( v.category_num==2 or v.category_num==8 ) then -- DEVICE_CATEGORY_DIMMABLE_LIGHT 51 61 table.insert (out, '<li class="bg">' .. lug_sPhoneRequest_light(k,v.description,lul_js) .. "</li>\n") 52 62 elseif( v.category_num==5 ) then -- DEVICE_CATEGORY_HVAC … … 58 68 elseif( v.category_num==17 ) then -- DEVICE_CATEGORY_TEMPERATURE 59 69 table.insert (out, '<li class="bg">' .. lug_sPhoneRequest_temp(k,v.description,lul_js) .. "</li>\n") 70 elseif( v.category_num==16 ) then -- DEVICE_CATEGORY_HUMIDITY 71 table.insert (out, '<li class="bg">' .. lug_sPhoneRequest_humid(k,v.description,lul_js) .. "</li>\n") 60 72 elseif( v.category_num==18 ) then -- DEVICE_CATEGORY_LIGHT 61 73 table.insert (out, '<li class="bg">' .. lug_sPhoneRequest_bright(k,v.description,lul_js) .. "</li>\n") … … 70 82 71 83 function lug_sPhoneRequest(lul_request,lul_parameters,lul_outputformat) 84 local lul_js = flag(lul_parameters.js) 85 g_is_remote = flag (lul_parameters.r) 86 -- if( lul_js==nil or tonumber(lul_js)==0 ) then 87 -- lul_js = 0 88 -- end 89 luup.log("lul_js = " .. lul_js) 72 90 local out = {html_header, [[ 73 91 <div id="toolbar" class="toolbar"><!--logout_btn--></div> … … 81 99 if not scene_grouphead_inserted then 82 100 table.insert (out, '<li class="group">Scenes</li>') 101 scene_grouphead_inserted = true 83 102 end 84 -- lul_html = lul_html .. '<li class="bg"><a href="data_request?id=lr_sPhone_action&remote=' .. v.remote .. '&page=' .. v.page .. '&room=' .. 0 .. '&device=0&service=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=' .. tostring(k) .. '&time=' .. tostring(os.clock()) .. '"><img src="/port_3480/L_sPhoneUI_layout/buttons/go.gif" alt="" width="36" height="36" border="0" align="absmiddle" class="icon"/></a> ' .. v.description .. '</li>\n'85 103 table.insert (out, ([[ 86 104 <li class="bg"> 87 <a href="data_request?id=lr_sPhone_action&remote= %{remote}%&page=%{page}%&room=%{room}%&device=0&service=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=%{scene_num}%&time=%{time}%">88 <img src=" /port_3480/L_sPhoneUI_layout/buttons/go.gif" alt="" width="36" height="36" border="0" align="absmiddle" class="icon"/>105 <a href="data_request?id=lr_sPhone_action&remote={%remote%}&page={%page%}&room={%room%}&device=0&service=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum={%scene_num%}&time={%time%}"> 106 <img src="{%sPh_LAYOUT_PFX%}/buttons/go.gif" alt="" width="36" height="36" border="0" align="absmiddle" class="icon"/> 89 107 </a> 90 %{description}%108 {%description%} 91 109 </li> 92 110 ]]):template { … … 101 119 end 102 120 103 -- lul_html = lul_html .. '<li class="group">My Home</li>'104 121 if next(luup.rooms) ~= nil then 105 122 table.insert (out, '<li class="group">My Home</li>') … … 107 124 108 125 for k,v in pairs(luup.rooms) do 109 -- lul_html = lul_html.. '<li><a class="pic" href="data_request?id=lr_sPhone_room&room=' .. tostring(k) .. '&time=' .. tostring(os.clock()) .. '">' .. v .. '</a></li>\r\n'110 126 table.insert (out, ([[ 111 <li><a class="pic" href="data_request?id=lr_sPhone_room&room= %{room}%&time=%{time}%">112 %{room_name}%127 <li><a class="pic" href="data_request?id=lr_sPhone_room&room={%room%}&time={%time%}"> 128 {%room_name%} 113 129 </a></li> 114 130 ]]):template { … … 119 135 end 120 136 121 list_devices (0, out )137 list_devices (0, out, lul_js) 122 138 123 -- lul_html = lul_html .. '</ul>'124 139 table.insert (out, '</ul>') 125 140 table.insert (out, html_footer) 126 141 127 -- lul_html = html_header .. lul_html .. html_footer128 142 return table.concat (out),"text/html" 129 143 end … … 139 153 140 154 if( lul_remote~=nil and tonumber(lul_remote)>0 ) then 141 html_header_action = [[155 html_header_action = ([[ 142 156 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 143 157 <html xmlns="http://www.w3.org/1999/xhtml"> … … 146 160 <meta http-equiv="pragma" content="nocache"/> 147 161 <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"/> 148 <meta http-equiv="refresh" content="0;url= \/port_3480/luvd/PK_Remote_' .. lul_remote .. '_' .. lul_page .. '.html" />149 <script src=" /port_3480/L_sPhoneUI_layout/js/mobile.js" language="javascript"></script>150 <link rel="stylesheet" href=" /port_3480/L_sPhoneUI_layout/css/iui.css" type="text/css" />162 <meta http-equiv="refresh" content="0;url="/port_3480/luvd/PK_Remote_{%lul_remote%}_{%lul_page%}.html" /> 163 <script src="{%sPh_LAYOUT_PFX%}/js/mobile.js" language="javascript"></script> 164 <link rel="stylesheet" href="{%sPh_LAYOUT_PFX%}/css/iui.css" type="text/css" /> 151 165 </head> 152 166 <body onLoad="js_prepare_urls();"> 153 ]] 167 ]]):template { 168 lul_remote = lul_remote, 169 lul_page, 170 } 154 171 else 155 172 html_header_action = html_header … … 161 178 return (html_header .. [[ 162 179 <div> 163 <img src=" /port_3480/L_sPhoneUI_layout/buttons/eror.gif" alt="" border="0" class="icon" align="absmiddle"/>180 <img src="{%sPh_LAYOUT_PFX%}/buttons/eror.gif" alt="" border="0" class="icon" align="absmiddle"/> 164 181 Internal Error: Missing arguments 165 182 </div> … … 174 191 return (html_header .. [[ 175 192 <div> 176 <img src=" /port_3480/L_sPhoneUI_layout/buttons/eror.gif" alt="" border="0" class="icon" align="absmiddle"/>193 <img src="{%sPh_LAYOUT_PFX%}/buttons/eror.gif" alt="" border="0" class="icon" align="absmiddle"/> 177 194 Internal Error: Invalid Device 178 195 </div> … … 196 213 local lul_resultcode,lul_resultstring,lul_job,lul_returnarguments = luup.call_action(lul_service,lul_action,lul_arguments,tonumber(lul_device)) 197 214 198 luup.log (("lug_sPhoneRequest_action: device: %{device}% action: %{action}% service %{service}% returned: %{resultcode}% str %{resultstring}% job %{job}%"):template {215 luup.log (("lug_sPhoneRequest_action: device: {%device%} action: {%action%} service {%service%} returned: {%resultcode%} str {%resultstring%} job {%job%}"):template { 199 216 device = lul_device, 200 217 action = lul_action, … … 207 224 if( lul_resultcode~=0 ) then 208 225 return ([[ 209 %{html_header}%226 {%html_header%} 210 227 <div> 211 <img src=" /port_3480/L_sPhoneUI_layout/buttons/eror.gif" alt="" border="0" class="icon" align="absmiddle"/>212 Error: %{lul_resultcode}%: %{lul_resultstring}%<br>213 <a href="data_request?id=lr_sPhone_room&room= %{room_num}%&time=%{time}%">OK - back</a><br>228 <img src="{%sPh_LAYOUT_PFX%}/buttons/eror.gif" alt="" border="0" class="icon" align="absmiddle"/> 229 Error: {%lul_resultcode%}: {%lul_resultstring%}<br> 230 <a href="data_request?id=lr_sPhone_room&room={%room_num%}&time={%time%}">OK - back</a><br> 214 231 </div> 215 %{html_footer}%232 {%html_footer%} 216 233 ]]):template { 217 html_header ,218 html_footer ,234 html_header = html_header, 235 html_footer = html_footer, 219 236 lul_resultcode = lul_resultcode, 220 237 lul_resultstring = lul_resultstring, … … 226 243 if ( lul_job==0 ) then 227 244 return ([[ 228 %{html_header_action}%245 {%html_header_action%} 229 246 <div id="toolbar" class="toolbar"> 230 <a href="data_request?id=lr_sPhone_room&room= %{room}%&time=%{time}%">231 <img src=" /port_3480/L_sPhoneUI_layout/images/backButton.gif" border="0">247 <a href="data_request?id=lr_sPhone_room&room={%room%}&time={%time%}"> 248 <img src="{%sPh_LAYOUT_PFX%}/images/backButton.gif" border="0"> 232 249 </a> 233 250 </div> 234 251 <div> 235 <img src=" /port_3480/L_sPhoneUI_layout/buttons/ok.gif" alt="" border="0" class="icon" align="absmiddle"/>252 <img src="{%sPh_LAYOUT_PFX%}/buttons/ok.gif" alt="" border="0" class="icon" align="absmiddle"/> 236 253 Command executed OK<br> 237 254 </div> 238 %{html_footer}%255 {%html_footer%} 239 256 ]]):template { 240 257 html_header_action = html_header_action, … … 246 263 247 264 return ([[ 248 %{html_header_action}%265 {%html_header_action%} 249 266 <div id="toolbar" class="toolbar"> 250 <a href="data_request?id=lr_sPhone_room&room= %{room}%&time=%{time}%">251 <img src=" /port_3480/L_sPhoneUI_layout/images/backButton.gif" border="0">267 <a href="data_request?id=lr_sPhone_room&room={%room%}&time={%time%}"> 268 <img src="{%sPh_LAYOUT_PFX%}/images/backButton.gif" border="0"> 252 269 </a> 253 270 </div> 254 271 <div> 255 <img src=" /port_3480/L_sPhoneUI_layout/buttons/wait.gif" alt="" border="0" class="icon" align="absmiddle"/>272 <img src="{%sPh_LAYOUT_PFX%}/buttons/wait.gif" alt="" border="0" class="icon" align="absmiddle"/> 256 273 Running command now...<br> 257 <a href="data_request?id=lr_sPhone_job&device= %{device}%&room=%{room}%&job=%{job}%&time=%{time}%">274 <a href="data_request?id=lr_sPhone_job&device={%device%}&room={%room%}&job={%job%}&time={%time%}"> 258 275 Check the status 259 276 </a> 260 277 </div> 261 %{html_footer}%278 {%html_footer%} 262 279 ]]):template { 263 280 html_header_action = html_header_action, … … 272 289 function lug_sPhoneRequest_camera(lul_device,lul_description,lul_js) 273 290 return ([[ 274 <img src=" /port_3480/L_sPhoneUI_layout/icons/camera.gif" alt="" width="44" height="43" align="absmiddle" class="icon"/>275 %{description}%<br>276 <a href="data_request?id=lr_sPhone_camimg&device= %{device}%&time=%{time}%&js=%{js}%">277 <img src=" /port_3480/L_sPhoneUI_layout/buttons/view.gif" alt="" border="0"/>291 <img src="{%sPh_LAYOUT_PFX%}/icons/camera.gif" alt="" width="44" height="43" align="absmiddle" class="icon"/> 292 {%description%} <br> 293 <a href="data_request?id=lr_sPhone_camimg&device={%device%}&time={%time%}&js={%js%}&r={%g_is_remote%}"> 294 <img src="{%sPh_LAYOUT_PFX%}/buttons/view.gif" alt="" border="0"/> 278 295 </a> 279 296 ]]):template { … … 297 314 if( lul_job_status==nil ) then 298 315 lul_text = [[ 299 <img src=" /port_3480/L_sPhoneUI_layout/buttons/eror.gif" alt="" border="0" class="icon" align="absmiddle"/>316 <img src="{%sPh_LAYOUT_PFX%}/buttons/eror.gif" alt="" border="0" class="icon" align="absmiddle"/> 300 317 No information on command.<br> 301 318 Command history is only kept for 30 seconds. … … 303 320 elseif( lul_job_status==0 or lul_job_status==1 or lul_job_status==5 ) then 304 321 lul_text = ([[ 305 <img src=" /port_3480/L_sPhoneUI_layout/buttons/wait.gif" alt="" border="0" class="icon" align="absmiddle"/>322 <img src="{%sPh_LAYOUT_PFX%}/buttons/wait.gif" alt="" border="0" class="icon" align="absmiddle"/> 306 323 Command is still running...<br> 307 <a href="data_request?id=lr_sPhone_job&device= %{device}%&room=%{room}%&job=%{job}%&time=%{time}%">Refresh</a>'324 <a href="data_request?id=lr_sPhone_job&device={%device%}&room={%room%}&job={%job%}&time={%time%}">Refresh</a>' 308 325 ]]):template { 309 326 device = lul_device, … … 314 331 elseif( lul_job_status==2 or lul_job_status==3 ) then 315 332 lul_text = [[ 316 <img src=" /port_3480/L_sPhoneUI_layout/buttons/eror.gif" alt="" border="0" class="icon" align="absmiddle"/>333 <img src="{%sPh_LAYOUT_PFX%}/buttons/eror.gif" alt="" border="0" class="icon" align="absmiddle"/> 317 334 Failed to run command 318 335 ]] 319 336 elseif( lul_job_status==4 ) then 320 337 lul_text = [[ 321 <img src=" /port_3480/L_sPhoneUI_layout/buttons/ok.gif" alt="" border="0" class="icon" align="absmiddle"/>338 <img src="{%sPh_LAYOUT_PFX%}/buttons/ok.gif" alt="" border="0" class="icon" align="absmiddle"/> 322 339 Command completed ok 323 340 ]] 324 341 else 325 342 lul_text = [[ 326 <img src=" /port_3480/L_sPhoneUI_layout/buttons/eror.gif" alt="" border="0" class="icon" align="absmiddle"/>343 <img src="{%sPh_LAYOUT_PFX%}/buttons/eror.gif" alt="" border="0" class="icon" align="absmiddle"/> 327 344 Unknown status:]] .. tostring(lul_job_status) 328 345 end 329 346 330 347 return ([[ 331 %{html_header}%348 {%html_header%} 332 349 <div id="toolbar" class="toolbar"> 333 <a href="data_request?id=lr_sPhone_room&room= %{room}%&time=%{time}%">334 <img src=" /port_3480/L_sPhoneUI_layout/images/backButton.gif" border="0">350 <a href="data_request?id=lr_sPhone_room&room={%room%}&time={%time%}"> 351 <img src="{%sPh_LAYOUT_PFX%}/images/backButton.gif" border="0"> 335 352 </a> 336 353 </div> 337 354 <div> 338 %{text}%355 {%text%} 339 356 </div> 340 %{html_footer}%357 {%html_footer%} 341 358 ]]):template { 342 359 html_header = html_header, … … 370 387 if( lul_js=='1' ) then 371 388 return ([[ 372 <img src="/port_3480/L_sPhoneUI_layout/icons/dimmable.gif" alt="" width="44" height="43" align="absmiddle" class="icon"/>%{description}%<br/> 373 <img src="/port_3480/L_sPhoneUI_layout/images/spacer.gif" border="0" width="20" height="20" id="action_icon_%{device}%"> 374 <a href="javascript:void(0);" onClick="set_device_icon(%{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room_num}%&device=%{device}%&service=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/off%{status_0}%.gif" alt="" border="0"/></a> 375 <a href="javascript:void(0);" onClick="set_device_icon(%{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room_num}%&device=%{device}%&service=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=25&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/25%{status_25}%.gif" alt="" border="0"/></a> 376 <a href="javascript:void(0);" onClick="set_device_icon(%{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room_num}%&device=%{device}%&service=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=50&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/50%{status_50}%.gif" alt="" border="0"/></a> 377 <a href="javascript:void(0);" onClick="set_device_icon(%{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room_num}%&device=%{device}%&service=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=75&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/75%{status_75}%.gif" alt="" border="0"/></a> 378 <a href="javascript:void(0);" onClick="set_device_icon(%{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room_num}%&device=%{device}%&service=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/on%{status_100}%.gif" alt="" border="0"/></a> (%{level}%) 379 ]]):template (tmpl_params) 380 else 381 return ([[ 382 <img src="/port_3480/L_sPhoneUI_layout/icons/dimmable.gif" alt="" width="44" height="43" align="absmiddle" class="icon"/>%{description}%<br/> 383 <img src="/port_3480/L_sPhoneUI_layout/images/spacer.gif" border="0" width="20" height="20" id="action_icon_%{device}%"> 384 <a href="javascript:void(0);" onClick="set_device_icon(%{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room_num}%&device=%{device}%&service=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/off%{status_0}%.gif" alt="" border="0"/></a> 385 <a href="javascript:void(0);" onClick="set_device_icon(%{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room_num}%&device=%{device}%&service=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=25&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/25%{status_25}%.gif" alt="" border="0"/></a> 386 <a href="javascript:void(0);" onClick="set_device_icon(%{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room_num}%&device=%{device}%&service=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=50&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/50%{status_50}%.gif" alt="" border="0"/></a> 387 <a href="javascript:void(0);" onClick="set_device_icon(%{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room_num}%&device=%{device}%&service=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=75&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/75%{status_75}%.gif" alt="" border="0"/></a> 388 <a href="javascript:void(0);" onClick="set_device_icon(%{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room_num}%&device=%{device}%&service=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/on%{status_100}%.gif" alt="" border="0"/></a> (%{level}%) 389 <img src="{%sPh_LAYOUT_PFX%}/icons/dimmable.gif" alt="" width="44" height="43" align="absmiddle" class="icon"/>{%description%}<br/> 390 <img src="{%sPh_LAYOUT_PFX%}/images/spacer.gif" border="0" width="20" height="20" id="action_icon_{%device%}"> 391 <a href="javascript:void(0);" onClick="set_device_icon({%device%},1);send_command('data_request?id=lr_sPhone_action_js&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0&time={%time%}',{%device%})"><img src="{%sPh_LAYOUT_PFX%}/buttons/off{%status_0%}.gif" alt="" border="0"/></a> 392 <a href="javascript:void(0);" onClick="set_device_icon({%device%},1);send_command('data_request?id=lr_sPhone_action_js&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=25&time={%time%}',{%device%})"><img src="{%sPh_LAYOUT_PFX%}/buttons/25{%status_25%}.gif" alt="" border="0"/></a> 393 <a href="javascript:void(0);" onClick="set_device_icon({%device%},1);send_command('data_request?id=lr_sPhone_action_js&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=50&time={%time%}',{%device%})"><img src="{%sPh_LAYOUT_PFX%}/buttons/50{%status_50%}.gif" alt="" border="0"/></a> 394 <a href="javascript:void(0);" onClick="set_device_icon({%device%},1);send_command('data_request?id=lr_sPhone_action_js&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=75&time={%time%}',{%device%})"><img src="{%sPh_LAYOUT_PFX%}/buttons/75{%status_75%}.gif" alt="" border="0"/></a> 395 <a href="javascript:void(0);" onClick="set_device_icon({%device%},1);send_command('data_request?id=lr_sPhone_action_js&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1&time={%time%}',{%device%})"><img src="{%sPh_LAYOUT_PFX%}/buttons/on{%status_100%}.gif" alt="" border="0"/></a> ({%level%}) 396 ]]):template (tmpl_params) 397 else 398 return ([[<img src="{%sPh_LAYOUT_PFX%}/icons/dimmable.gif" alt="" width="44" height="43" align="absmiddle" class="icon"/>{%description%}<br/> 399 <a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/buttons/off{%status_0%}.gif" alt="" border="0"/></a> 400 <a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=25&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/buttons/25{%status_25%}.gif" alt="" border="0"/></a> 401 <a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=50&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/buttons/50{%status_50%}.gif" alt="" border="0"/></a> 402 <a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=75&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/buttons/75{%status_75%}.gif" alt="" border="0"/></a> 403 <a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/buttons/on{%status_100%}.gif" alt="" border="0"/></a> 389 404 ]]):template (tmpl_params) 390 405 end … … 405 420 if( lul_js=='1' ) then 406 421 return ([[ 407 <img src=" /port_3480/L_sPhoneUI_layout/icons/switch.gif" alt="" width="44" height="43" align="absmiddle" class="icon" id="pic_device_%{device}%" />%{description}%<br>408 <img src=" /port_3480/L_sPhoneUI_layout/images/spacer.gif" border="0" width="20" height="20" id="action_icon_%{lul_device}%">409 <a href="javascript:void(0);" onClick="set_device_icon( %{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room}%&device=%{device}%&service=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/off%{status_0}%.gif" alt="" border="0"/></a>410 <a href="javascript:void(0);" onClick="set_device_icon( %{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room}%&device=%{device}%&service=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/on%{status_100}%.gif" alt="" border="0"/></a>411 ]]):template (tmpl_params) 412 else 413 return ([[ 414 <img src=" /port_3480/L_sPhoneUI_layout/icons/switch.gif" alt="" width="44" height="43" align="absmiddle" class="icon" />%{description}%<br>415 <a href="data_request?id=lr_sPhone_action&room= %{room}%&device=%{device}%&service=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0&time=%{time}%"><img src="/port_3480/L_sPhoneUI_layout/buttons/off%{status_0}%.gif" alt="" border="0"/></a>416 <a href="data_request?id=lr_sPhone_action&room= %{room}%&device=%{device}%&service=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1&time=%{time}%"><img src="/port_3480/L_sPhoneUI_layout/buttons/on%{status_100}%.gif" alt="" border="0"/></a>422 <img src="{%sPh_LAYOUT_PFX%}/icons/switch.gif" alt="" width="44" height="43" align="absmiddle" class="icon" id="pic_device_{%device%}" />{%description%}<br> 423 <img src="{%sPh_LAYOUT_PFX%}/images/spacer.gif" border="0" width="20" height="20" id="action_icon_{%lul_device%}"> 424 <a href="javascript:void(0);" onClick="set_device_icon({%device%},1);send_command('data_request?id=lr_sPhone_action_js&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0&time={%time%}',{%device%})"><img src="{%sPh_LAYOUT_PFX%}/buttons/off{%status_0%}.gif" alt="" border="0"/></a> 425 <a href="javascript:void(0);" onClick="set_device_icon({%device%},1);send_command('data_request?id=lr_sPhone_action_js&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1&time={%time%}',{%device%})"><img src="{%sPh_LAYOUT_PFX%}/buttons/on{%status_100%}.gif" alt="" border="0"/></a> 426 ]]):template (tmpl_params) 427 else 428 return ([[ 429 <img src="{%sPh_LAYOUT_PFX%}/icons/switch.gif" alt="" width="44" height="43" align="absmiddle" class="icon" />{%description%}<br> 430 <a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/buttons/off{%status_0%}.gif" alt="" border="0"/></a> 431 <a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/buttons/on{%status_100%}.gif" alt="" border="0"/></a> 417 432 ]]):template (tmpl_params) 418 433 end … … 444 459 if( lul_js=='1' ) then 445 460 return ([[ 446 <img src=" /port_3480/L_sPhoneUI_layout/icons/security.gif" alt="" width="44" height="43" align="absmiddle" class="icon" id="pic_device_%{device}%" />%{description}%<br>447 <img src=" /port_3480/L_sPhoneUI_layout/images/spacer.gif" border="0" width="20" height="20" id="action_icon_%{lul_device}%">448 <a href="javascript:void(0);" onClick="set_device_icon( %{device}%,1);send_command('data_request?id=lu_variableset&DeviceNum=%{device}%&serviceId=urn:micasaverde-com:serviceId:SecuritySensor1&Variable=Tripped&Value=1&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/images/%{status_tripped}%_circle.gif" alt="" border="0"/></a>449 <a href="javascript:void(0);" onClick="set_device_icon( %{device}%,1);send_command('data_request?id=lu_variableset&DeviceNum=%{device}%&serviceId=urn:micasaverde-com:serviceId:SecuritySensor1&Variable=Armed&Value=1&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/arm%{status_arm}%.gif" alt="" border="0"/></a>450 <a href="javascript:void(0);" onClick="set_device_icon( %{device}%,1);send_command('data_request?id=lu_variableset&DeviceNum=%{device}%&serviceId=urn:micasaverde-com:serviceId:SecuritySensor1&Variable=Armed&Value=0&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/bypass%{status_bypass}%.gif" alt="" border="0"/></a>451 %{temp}%452 ]]):template (tmpl_params) 453 else 454 return ([[ 455 <img src=" /port_3480/L_sPhoneUI_layout/icons/security.gif" alt="" width="44" height="43" align="absmiddle" class="icon" />%{description}%<br>456 <a href="data_request?id=lu_variableset&DeviceNum= %{device}%&serviceId=urn:micasaverde-com:serviceId:SecuritySensor1&Variable=Tripped&time=%{time}%"><img src="/port_3480/L_sPhoneUI_layout/images/%{status_tripped}%_circle.gif" alt="" border="0"/></a>457 <a href="data_request?id=lu_variableset&DeviceNum= %{device}%&serviceId=urn:micasaverde-com:serviceId:SecuritySensor1&Variable=Armed&Value=1&time=%{time}%"><img src="/port_3480/L_sPhoneUI_layout/buttons/arm%{status_arm}%.gif" alt="" border="0"/></a>458 <a href="data_request?id=lu_variableset&DeviceNum= %{device}%&serviceId=urn:micasaverde-com:serviceId:SecuritySensor1&Variable=Armed&Value=0&time=%{time}%"><img src="/port_3480/L_sPhoneUI_layout/buttons/bypass%{status_bypass}%.gif" alt="" border="0"/></a>459 %{temp}%461 <img src="{%sPh_LAYOUT_PFX%}/icons/security.gif" alt="" width="44" height="43" align="absmiddle" class="icon" id="pic_device_{%device%}" />{%description%}<br> 462 <img src="{%sPh_LAYOUT_PFX%}/images/spacer.gif" border="0" width="20" height="20" id="action_icon_{%lul_device%}"> 463 <a href="javascript:void(0);" onClick="set_device_icon({%device%},1);send_command('data_request?id=lu_variableset&DeviceNum={%device%}&serviceId=urn:micasaverde-com:serviceId:SecuritySensor1&Variable=Tripped&Value=1&time={%time%}',{%device%})"><img src="{%sPh_LAYOUT_PFX%}/images/{%status_tripped%}_circle.gif" alt="" border="0"/></a> 464 <a href="javascript:void(0);" onClick="set_device_icon({%device%},1);send_command('data_request?id=lu_variableset&DeviceNum={%device%}&serviceId=urn:micasaverde-com:serviceId:SecuritySensor1&Variable=Armed&Value=1&time={%time%}',{%device%})"><img src="{%sPh_LAYOUT_PFX%}/buttons/arm{%status_arm%}.gif" alt="" border="0"/></a> 465 <a href="javascript:void(0);" onClick="set_device_icon({%device%},1);send_command('data_request?id=lu_variableset&DeviceNum={%device%}&serviceId=urn:micasaverde-com:serviceId:SecuritySensor1&Variable=Armed&Value=0&time={%time%}',{%device%})"><img src="{%sPh_LAYOUT_PFX%}/buttons/bypass{%status_bypass%}.gif" alt="" border="0"/></a> 466 {%temp%} 467 ]]):template (tmpl_params) 468 else 469 return ([[ 470 <img src="{%sPh_LAYOUT_PFX%}/icons/security.gif" alt="" width="44" height="43" align="absmiddle" class="icon" />{%description%}<br> 471 <a href="data_request?id=lu_variableset&DeviceNum={%device%}&serviceId=urn:micasaverde-com:serviceId:SecuritySensor1&Variable=Tripped&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/images/{%status_tripped%}_circle.gif" alt="" border="0"/></a> 472 <a href="data_request?id=lu_variableset&DeviceNum={%device%}&serviceId=urn:micasaverde-com:serviceId:SecuritySensor1&Variable=Armed&Value=1&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/buttons/arm{%status_arm%}.gif" alt="" border="0"/></a> 473 <a href="data_request?id=lu_variableset&DeviceNum={%device%}&serviceId=urn:micasaverde-com:serviceId:SecuritySensor1&Variable=Armed&Value=0&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/buttons/bypass{%status_bypass%}.gif" alt="" border="0"/></a> 474 {%temp%} 460 475 ]]):template (tmpl_params) 461 476 end … … 472 487 if( lul_js=='1' ) then 473 488 return ([[ 474 <img src="/port_3480/L_sPhoneUI_layout/icons/thermostat.gif" alt="" width="44" height="43" align="absmiddle" class="icon" id="pic_device_%{device}%" />%{description}%<br> 475 <img src="/port_3480/L_sPhoneUI_layout/images/spacer.gif" border="0" width="20" height="20" id="action_icon_%{device}%"> 476 Temperature: %{temp}%°<br/> 477 ]]):template (tmpl_params) 478 else 479 return ([[ 480 <img src="/port_3480/L_sPhoneUI_layout/icons/thermostat.gif" alt="" width="44" height="43" align="absmiddle" class="icon" />%{description}%<br> 481 Temperature: %{temp}%°<br/> 489 <img src="{%sPh_LAYOUT_PFX%}/icons/thermostat.gif" alt="" width="44" height="43" align="absmiddle" class="icon" id="pic_device_{%device%}" />{%description%}<br> 490 <img src="{%sPh_LAYOUT_PFX%}/images/spacer.gif" border="0" width="20" height="20" id="action_icon_{%device%}"> 491 Temperature: {%temp%}°<br/> 492 ]]):template (tmpl_params) 493 else 494 return ([[ 495 <img src="{%sPh_LAYOUT_PFX%}/icons/thermostat.gif" alt="" width="44" height="43" align="absmiddle" class="icon" />{%description%}<br> 496 Temperature: {%temp%}°<br/> 497 ]]):template (tmpl_params) 498 end 499 end 500 501 function lug_sPhoneRequest_humid(lul_device, lul_description, lul_js) 502 local lul_humid = luup.variable_get ('urn:micasaverde-com:serviceId:HumiditySensor1', 'CurrentLevel', lul_device) 503 local tmpl_params = { 504 device = lul_device, 505 description = lul_description, 506 humid = lul_humid or 'N/A', 507 } 508 509 if (lul_js=='1') then 510 return ([[ 511 <img src="{%sPh_LAYOUT_PFX%}/icons/thermostat.gif" alt="" width="44" height="43" align="absmiddle" class="icon" id="pic_device_{%device%}" />{%description%}<br> 512 <img src="{%sPh_LAYOUT_PFX%}/images/spacer.gif" border="0" width="20" height="20" id="action_icon_{%device%}"> 513 Humidity: {%humid%}%<br/> 514 ]]):template (tmpl_params) 515 else 516 return ([[ 517 <img src="{%sPh_LAYOUT_PFX%}/icons/thermostat.gif" alt="" width="44" height="43" align="absmiddle" class="icon" />{%description%}<br> 518 Humidity: {%humid%}%<br/> 482 519 ]]):template (tmpl_params) 483 520 end … … 494 531 if( lul_js=='1' ) then 495 532 return ([[ 496 <img src=" /port_3480/L_sPhoneUI_layout/icons/brightness.gif" alt="" width="44" height="43" align="absmiddle" class="icon" id="pic_device_%{device}%" />%{description}%<br>497 <img src=" /port_3480/L_sPhoneUI_layout/images/spacer.gif" border="0" width="20" height="20" id="action_icon_%{device}%">498 Light level: %{level}%<br/>533 <img src="{%sPh_LAYOUT_PFX%}/icons/brightness.gif" alt="" width="44" height="43" align="absmiddle" class="icon" id="pic_device_{%device%}" />{%description%}<br> 534 <img src="{%sPh_LAYOUT_PFX%}/images/spacer.gif" border="0" width="20" height="20" id="action_icon_{%device%}"> 535 Light level: {%level%}%<br/> 499 536 ]]):template(tmpl_params) 500 537 else 501 538 return ([[ 502 <img src=" /port_3480/L_sPhoneUI_layout/icons/brightness.gif" alt="" width="44" height="43" align="absmiddle" class="icon" />%{description}%<br>503 Light level: %{lul_Level}%<br/>539 <img src="{%sPh_LAYOUT_PFX%}/icons/brightness.gif" alt="" width="44" height="43" align="absmiddle" class="icon" />{%description%}<br> 540 Light level: {%level%}%<br/> 504 541 ]]):template(tmpl_params) 505 542 end … … 529 566 if( lul_js=='1' ) then 530 567 return ([[ 531 <img src=" /port_3480/L_sPhoneUI_layout/icons/thermostat.gif" alt="" width="44" height="43" align="absmiddle" class="icon"/>%{description}%<br>532 <img src=" /port_3480/L_sPhoneUI_layout/images/spacer.gif" border="0" width="20" height="20" id="action_icon_%{device}%">533 <a href="javascript:void(0);" onClick="set_device_icon( %{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room}%&device=%{device}%&service=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&NewModeTarget=Off&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/off%{status_off}%.gif" alt="" border="0"/></a>534 <a href="javascript:void(0);" onClick="set_device_icon( %{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room}%&device=%{device}%&service=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&NewModeTarget=CoolOn&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/cool%{status_cool}%.gif" alt="" border="0"/></a>535 <a href="javascript:void(0);" onClick="set_device_icon( %{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room}%&device=%{device}%&service=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&NewModeTarget=HeatOn&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/heat%{status_heat}%.gif" alt="" border="0"/></a>536 <a href="javascript:void(0);" onClick="set_device_icon( %{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room}%&device=%{device}%&service=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&NewModeTarget=AutoChangeOver&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/auto%{status_auto}%.gif" alt="" border="0"/></a> <br/>537 Fan: <a href="javascript:void(0);" onClick="set_device_icon(' %{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room}%&device=%{device}%&service=urn:upnp-org:serviceId:HVAC_FanOperatingMode1&action=SetMode&NewMode=Auto&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/auto%{status_fan_auto}%.gif" alt="" border="0"/></a>538 <a href="javascript:void(0);" onClick="set_device_icon( %{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room}%&device=%{device}%&service=urn:upnp-org:serviceId:HVAC_FanOperatingMode1&action=SetMode&NewMode=ContinuousOn&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/on%{status_fan_on}%.gif" alt="" border="0"/></a><br/>568 <img src="{%sPh_LAYOUT_PFX%}/icons/thermostat.gif" alt="" width="44" height="43" align="absmiddle" class="icon"/>{%description%}<br> 569 <img src="{%sPh_LAYOUT_PFX%}/images/spacer.gif" border="0" width="20" height="20" id="action_icon_{%device%}"> 570 <a href="javascript:void(0);" onClick="set_device_icon({%device%},1);send_command('data_request?id=lr_sPhone_action_js&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&NewModeTarget=Off&time={%time%}',{%device%})"><img src="{%sPh_LAYOUT_PFX%}/buttons/off{%status_off%}.gif" alt="" border="0"/></a> 571 <a href="javascript:void(0);" onClick="set_device_icon({%device%},1);send_command('data_request?id=lr_sPhone_action_js&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&NewModeTarget=CoolOn&time={%time%}',{%device%})"><img src="{%sPh_LAYOUT_PFX%}/buttons/cool{%status_cool%}.gif" alt="" border="0"/></a> 572 <a href="javascript:void(0);" onClick="set_device_icon({%device%},1);send_command('data_request?id=lr_sPhone_action_js&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&NewModeTarget=HeatOn&time={%time%}',{%device%})"><img src="{%sPh_LAYOUT_PFX%}/buttons/heat{%status_heat%}.gif" alt="" border="0"/></a> 573 <a href="javascript:void(0);" onClick="set_device_icon({%device%},1);send_command('data_request?id=lr_sPhone_action_js&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&NewModeTarget=AutoChangeOver&time={%time%}',{%device%})"><img src="{%sPh_LAYOUT_PFX%}/buttons/auto{%status_auto%}.gif" alt="" border="0"/></a> <br/> 574 Fan: <a href="javascript:void(0);" onClick="set_device_icon('{%device%},1);send_command('data_request?id=lr_sPhone_action_js&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:HVAC_FanOperatingMode1&action=SetMode&NewMode=Auto&time={%time%}',{%device%})"><img src="{%sPh_LAYOUT_PFX%}/buttons/auto{%status_fan_auto%}.gif" alt="" border="0"/></a> 575 <a href="javascript:void(0);" onClick="set_device_icon({%device%},1);send_command('data_request?id=lr_sPhone_action_js&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:HVAC_FanOperatingMode1&action=SetMode&NewMode=ContinuousOn&time={%time%}',{%device%})"><img src="{%sPh_LAYOUT_PFX%}/buttons/on{%status_fan_on%}.gif" alt="" border="0"/></a><br/> 539 576 <table cellpadding="2" cellspacing="0"> 540 577 <tr> 541 578 <td>Heat: </td> 542 <td><input type="text" name="NewCurrentSetpoint" id="NewCurrentSetpoint_Heat_ %{device}%" value="" size="3"></td>543 <td><img src=" /port_3480/L_sPhoneUI_layout/images/set_deasupra.gif" border="0" onClick="set_device_icon(%{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room}%&device=%{device}%&service=urn:upnp-org:serviceId:TemperatureSetpoint1_Heat&action=SetCurrentSetpoint&NewCurrentSetpoint='+document.getElementById('NewCurrentSetpoint_Heat_%{device}%').value+'&time=%{time}%',%{device}%);" border="0"></td>579 <td><input type="text" name="NewCurrentSetpoint" id="NewCurrentSetpoint_Heat_{%device%}" value="" size="3"></td> 580 <td><img src="{%sPh_LAYOUT_PFX%}/images/set_deasupra.gif" border="0" onClick="set_device_icon({%device%},1);send_command('data_request?id=lr_sPhone_action_js&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:TemperatureSetpoint1_Heat&action=SetCurrentSetpoint&NewCurrentSetpoint='+document.getElementById('NewCurrentSetpoint_Heat_{%device%}').value+'&time={%time%}',{%device%});" border="0"></td> 544 581 </tr> 545 582 546 583 <tr> 547 584 <td>Cool: </td> 548 <td><input type="text" name="NewCurrentSetpoint" id="NewCurrentSetpoint_Cool_ %{device}%" value="" size="3"></td>549 <td><img src=" /port_3480/L_sPhoneUI_layout/images/set_deasupra.gif" border="0" onClick="set_device_icon(%{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room}%&device=%{device}%&service=urn:upnp-org:serviceId:TemperatureSetpoint1_Cool&action=SetCurrentSetpoint&NewCurrentSetpoint='+document.getElementById('NewCurrentSetpoint_Cool_%{device}%').value+'&time=%{time}%',%{device}%);" border="0"></td>585 <td><input type="text" name="NewCurrentSetpoint" id="NewCurrentSetpoint_Cool_{%device%}" value="" size="3"></td> 586 <td><img src="{%sPh_LAYOUT_PFX%}/images/set_deasupra.gif" border="0" onClick="set_device_icon({%device%},1);send_command('data_request?id=lr_sPhone_action_js&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:TemperatureSetpoint1_Cool&action=SetCurrentSetpoint&NewCurrentSetpoint='+document.getElementById('NewCurrentSetpoint_Cool_{%device%}').value+'&time={%time%}',{%device%});" border="0"></td> 550 587 </tr> 551 588 </table> 552 Current temperature: %{temp}%°<br/>553 Set point heat: %{setPointHeat}%°<br/>554 Set point cool: %{setPointCool}%°555 ]]):template (tmpl_params) 556 else 557 return ([[ 558 <img src=" /port_3480/L_sPhoneUI_layout/icons/thermostat.gif" alt="" width="44" height="43" align="absmiddle" class="icon"/>%{description}%<br>559 <a href="data_request?id=lr_sPhone_action&room= %{room}%&device=%{device}%&service=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&NewModeTarget=Off&time=%{time}%"><img src="/port_3480/L_sPhoneUI_layout/buttons/off%{status_off}%.gif" alt="" border="0"/></a>560 <a href="data_request?id=lr_sPhone_action&room= %{room}%&device=%{device}%&service=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&NewModeTarget=CoolOn&time=%{time}%"><img src="/port_3480/L_sPhoneUI_layout/buttons/cool%{status_cool}%.gif" alt="" border="0"/></a>561 <a href="data_request?id=lr_sPhone_action&room= %{room}%&device=%{device}%&service=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&NewModeTarget=HeatOn&time=%{time}%"><img src="/port_3480/L_sPhoneUI_layout/buttons/heat%{status_heat}%.gif" alt="" border="0"/></a>562 <a href="data_request?id=lr_sPhone_action&room= %{room}%&device=%{device}%&service=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&NewModeTarget=AutoChangeOver&time=%{time}%"><img src="/port_3480/L_sPhoneUI_layout/buttons/auto%{status_auto}%.gif" alt="" border="0"/></a> <br/>563 Fan: <a href="\data_request?id=lr_sPhone_action&room= %{room}%&device=%{device}%&service=urn:upnp-org:serviceId:HVAC_FanOperatingMode1&action=SetMode&NewMode=Auto&time=%{time}%"><img src="/port_3480/L_sPhoneUI_layout/buttons/auto%{status_fan_auto}%.gif" alt="" border="0"/></a>564 <a href="\data_request?id=lr_sPhone_action&room= %{room}%&device=%{device}%&service=urn:upnp-org:serviceId:HVAC_FanOperatingMode1&action=SetMode&NewMode=ContinuousOn&time=%{time}%"><img src="/port_3480/L_sPhoneUI_layout/buttons/on%{status_fan_on}%.gif" alt="" border="0"/></a><br/>589 Current temperature: {%temp%}°<br/> 590 Set point heat: {%setPointHeat%}°<br/> 591 Set point cool: {%setPointCool%}° 592 ]]):template (tmpl_params) 593 else 594 return ([[ 595 <img src="{%sPh_LAYOUT_PFX%}/icons/thermostat.gif" alt="" width="44" height="43" align="absmiddle" class="icon"/>{%description%}<br> 596 <a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&NewModeTarget=Off&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/buttons/off{%status_off%}.gif" alt="" border="0"/></a> 597 <a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&NewModeTarget=CoolOn&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/buttons/cool{%status_cool%}.gif" alt="" border="0"/></a> 598 <a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&NewModeTarget=HeatOn&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/buttons/heat{%status_heat%}.gif" alt="" border="0"/></a> 599 <a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&NewModeTarget=AutoChangeOver&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/buttons/auto{%status_auto%}.gif" alt="" border="0"/></a> <br/> 600 Fan: <a href="\data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:HVAC_FanOperatingMode1&action=SetMode&NewMode=Auto&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/buttons/auto{%status_fan_auto%}.gif" alt="" border="0"/></a> 601 <a href="\data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:upnp-org:serviceId:HVAC_FanOperatingMode1&action=SetMode&NewMode=ContinuousOn&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/buttons/on{%status_fan_on%}.gif" alt="" border="0"/></a><br/> 565 602 <table cellpadding="2" cellspacing="0"> 566 603 <form action="\data_request" method="get"> 567 604 <input type="hidden" name="id" value="lr_sPhone_action"> 568 <input type="hidden" name="room" value=" %{room}%">569 <input type="hidden" name="device" value=" %{device}%">605 <input type="hidden" name="room" value="{%room%}"> 606 <input type="hidden" name="device" value="{%device%}"> 570 607 <input type="hidden" name="service" value="urn:upnp-org:serviceId:TemperatureSetpoint1_Heat"> 571 608 <input type="hidden" name="action" value="SetCurrentSetpoint"> 572 <input type="hidden" name="time" value=" %{time}%">609 <input type="hidden" name="time" value="{%time%}"> 573 610 <tr> 574 611 <td>Heat: </td> 575 612 <td><input type="text" name="NewCurrentSetpoint" value="" size="3"></td> 576 <td><input type="image" src=" /port_3480/L_sPhoneUI_layout/images/set_deasupra.gif" border="0"></td>613 <td><input type="image" src="{%sPh_LAYOUT_PFX%}/images/set_deasupra.gif" border="0"></td> 577 614 </tr> 578 615 </form> 579 616 <form action="\data_request" method="get"> 580 617 <input type="hidden" name="id" value="lr_sPhone_action"> 581 <input type="hidden" name="room" value=" %{room}%">582 <input type="hidden" name="device" value=" %{device}%">618 <input type="hidden" name="room" value="{%room%}"> 619 <input type="hidden" name="device" value="{%device%}"> 583 620 <input type="hidden" name="service" value="urn:upnp-org:serviceId:TemperatureSetpoint1_Cool"> 584 621 <input type="hidden" name="action" value="SetCurrentSetpoint"> 585 <input type="hidden" name="time" value=" %{time}%">622 <input type="hidden" name="time" value="{%time%}"> 586 623 587 624 <tr> 588 625 <td>Cool: </td> 589 626 <td><input type="text" name="NewCurrentSetpoint" value="" size="3"></td> 590 <td><input type="image" src=" /port_3480/L_sPhoneUI_layout/images/set_deasupra.gif" border="0"></td>627 <td><input type="image" src="{%sPh_LAYOUT_PFX%}/images/set_deasupra.gif" border="0"></td> 591 628 </tr> 592 629 </form> 593 630 </table> 594 Current temperature: %{temp}%°<br/>595 Set point heat: %{setPointHeat}%°<br/>596 Set point cool: %{setPointCool}%°'631 Current temperature: {%temp%}°<br/> 632 Set point heat: {%setPointHeat%}°<br/> 633 Set point cool: {%setPointCool%}°' 597 634 ]]):template (tmpl_params) 598 635 end … … 623 660 table.insert (o, ([[ 624 661 <tr> 625 <td> %{part_5}%</td>626 <td><a href="data_request?id=lr_sPhone_action&room= %{room}%&device=%{device}%&service=urn:micasaverde-com:serviceId:DoorLock1&action=ClearPin&UserCode=%{part_1}%&time=%{time}%"><img src="/port_3480/L_sPhoneUI_layout/images/remove_deasupra.gif" border="0"></a></td>662 <td>{%part_5%}</td> 663 <td><a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:micasaverde-com:serviceId:DoorLock1&action=ClearPin&UserCode={%part_1%}&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/images/remove_deasupra.gif" border="0"></a></td> 627 664 </tr> 628 665 ]]):template (tmpl_params)) … … 634 671 635 672 636 if( lul_js =='1') then637 return ([[ 638 %{description}%<br>639 <img src=" /port_3480/L_sPhoneUI_layout/images/spacer.gif" border="0" width="20" height="20" id="action_icon_%{device}%">640 <a href="javascript:void(0);" onClick="set_device_icon( %{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room}%&device=%{device}%&service=urn:micasaverde-com:serviceId:DoorLock1&action=SetTarget&newTargetValue=0&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/unlock%{status_unlock}%.gif" alt="" border="0"/></a>641 <a href="javascript:void(0);" onClick="set_device_icon( %{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room}%&device=%{device}%&service=urn:micasaverde-com:serviceId:DoorLock1&action=SetTarget&newTargetValue=1&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/lock%{status_lock}%.gif" alt="" border="0"/></a>673 if( lul_js == '1') then 674 return ([[ 675 {%description%}<br> 676 <img src="{%sPh_LAYOUT_PFX%}/images/spacer.gif" border="0" width="20" height="20" id="action_icon_{%device%}"> 677 <a href="javascript:void(0);" onClick="set_device_icon({%device%},1);send_command('data_request?id=lr_sPhone_action_js&room={%room%}&device={%device%}&service=urn:micasaverde-com:serviceId:DoorLock1&action=SetTarget&newTargetValue=0&time={%time%}',{%device%})"><img src="{%sPh_LAYOUT_PFX%}/buttons/unlock{%status_unlock%}.gif" alt="" border="0"/></a> 678 <a href="javascript:void(0);" onClick="set_device_icon({%device%},1);send_command('data_request?id=lr_sPhone_action_js&room={%room%}&device={%device%}&service=urn:micasaverde-com:serviceId:DoorLock1&action=SetTarget&newTargetValue=1&time={%time%}',{%device%})"><img src="{%sPh_LAYOUT_PFX%}/buttons/lock{%status_lock%}.gif" alt="" border="0"/></a> 642 679 <form action="data_request" method="get"> 643 680 <input type="hidden" name="id" value="lr_sPhone_action"> 644 <input type="hidden" name="room" value=" %{room}%">645 <input type="hidden" name="device" value=" %{device}%">681 <input type="hidden" name="room" value="{%room%}"> 682 <input type="hidden" name="device" value="{%device%}"> 646 683 <input type="hidden" name="service" value="urn:micasaverde-com:serviceId:DoorLock1"> 647 684 <input type="hidden" name="action" value="SetPin"> 648 <input type="hidden" name="time" value=" %{time}%">685 <input type="hidden" name="time" value="{%time%}"> 649 686 <table cellpadding="2" cellspacing="0"> 650 687 <tr> 651 688 <td>New code:</td> 652 <td><input type="text" name="UserCodeName" id="UserCodeName_ %{device}%" value="" size="8"></td>689 <td><input type="text" name="UserCodeName" id="UserCodeName_{%device%}" value="" size="8"></td> 653 690 </tr> 654 691 <tr> 655 692 <td>PIN code:</td> 656 <td><input type="text" name="newPin" id="newPin_ %{device}%" value="" size="8"></td>693 <td><input type="text" name="newPin" id="newPin_{%device%}" value="" size="8"></td> 657 694 </tr> 658 695 <tr> 659 696 <td></td> 660 <td><img src=" /port_3480/L_sPhoneUI_layout/images/set_deasupra.gif" border="0" onClick="set_device_icon(%{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room}%&device=%{device}%&service=urn:micasaverde-com:serviceId:DoorLock1&action=SetPin&UserCodeName='+document.getElementById('UserCodeName_%{device}%').value+'&newPin='+document.getElementById('UserCodeName_%{device}%').value+'&time=%{time}%',%{device}%)"></td>697 <td><img src="{%sPh_LAYOUT_PFX%}/images/set_deasupra.gif" border="0" onClick="set_device_icon({%device%},1);send_command('data_request?id=lr_sPhone_action_js&room={%room%}&device={%device%}&service=urn:micasaverde-com:serviceId:DoorLock1&action=SetPin&UserCodeName='+document.getElementById('UserCodeName_{%device%}').value+'&newPin='+document.getElementById('UserCodeName_{%device%}').value+'&time={%time%}',{%device%})"></td> 661 698 </tr> 662 699 </table> 663 700 </form> 664 %{existing_codes}% 665 ]]):template (tmpl_params) 666 else 667 return ([[ 668 %{description}%<br> 669 <img src="/port_3480/L_sPhoneUI_layout/images/spacer.gif" border="0" width="20" height="20" id="action_icon_%{device}%"> 670 <a href="javascript:void(0);" onClick="set_device_icon(%{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room}%&device=%{device}%&service=urn:micasaverde-com:serviceId:DoorLock1&action=SetTarget&newTargetValue=0&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/unlock%{status_unlock}%.gif" alt="" border="0"/></a> 671 <a href="javascript:void(0);" onClick="set_device_icon(%{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room}%&device=%{device}%&service=urn:micasaverde-com:serviceId:DoorLock1&action=SetTarget&newTargetValue=1&time=%{time}%',%{device}%)"><img src="/port_3480/L_sPhoneUI_layout/buttons/lock%{status_lock}%.gif" alt="" border="0"/></a> 701 {%existing_codes%} 702 ]]):template (tmpl_params) 703 else 704 return ([[ 705 {%lul_description%}<br> 706 <a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:micasaverde-com:serviceId:DoorLock1&action=SetTarget&newTargetValue=0&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/buttons/unlock{%status_unlock%}.gif" alt="" border="0"/></a> 707 <a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:micasaverde-com:serviceId:DoorLock1&action=SetTarget&newTargetValue=1&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/buttons/lock{%status%}.gif" alt="" border="0"/></a> 672 708 <form action="data_request" method="get"> 673 <input type="hidden" name="id" value="lr_sPhone_action">674 <input type="hidden" name="room" value="%{room}%">675 <input type="hidden" name="device" value="%{device}%">676 <input type="hidden" name="service" value="urn:micasaverde-com:serviceId:DoorLock1">677 <input type="hidden" name="action" value="SetPin">678 <input type="hidden" name="time" value="%{time}%">679 <table cellpadding="2" cellspacing="0">680 <tr>681 <td>New code:</td>682 <td><input type="text" name="UserCodeName" id="UserCodeName_%{device}%" value="" size="8"></td>683 </tr>684 <tr>685 <td>PINcode:</td>686 <td><input type="text" name="newPin" id="newPin_%{device}%" value="" size="8"></td>687 </tr>688 <tr>689 <td></td>690 <td><img src="/port_3480/L_sPhoneUI_layout/images/set_deasupra.gif" border="0" onClick="set_device_icon(%{device}%,1);send_command('data_request?id=lr_sPhone_action_js&room=%{room}%&device=%{device}%&service=urn:micasaverde-com:serviceId:DoorLock1&action=SetPin&UserCodeName='+document.getElementById('UserCodeName_%{device}%').value+'&newPin='+document.getElementById('UserCodeName_%{device}%').value+'&time=%{time}%',%{device}%)"></td>691 </tr>692 </table>709 <input type="hidden" name="id" value="lr_sPhone_action"> 710 <input type="hidden" name="room" value="{%room%}"> 711 <input type="hidden" name="device" value="{%device%}"> 712 <input type="hidden" name="service" value="urn:micasaverde-com:serviceId:DoorLock1"> 713 <input type="hidden" name="action" value="SetPin"> 714 <input type="hidden" name="time" value="{%time%}"> 715 <table cellpadding="2" cellspacing="0"> 716 <tr> 717 <td>New code:</td> 718 <td><input type="text" name="UserCodeName" value="" size="4"></td> 719 </tr> 720 <tr> 721 <td>4 digit code:</td> 722 <td><input type="text" name="newPin" value="" size="4"></td> 723 </tr> 724 <tr> 725 <td></td> 726 <td><input type="image" src="{%sPh_LAYOUT_PFX%}/images/set_deasupra.gif" border="0"></td> 727 </tr> 728 </table> 693 729 </form> 694 %{existing_codes}%730 {%existing_codes%} 695 731 ]]):template (tmpl_params) 696 732 end … … 699 735 function lug_sPhoneRequest_camimg(lul_request,lul_parameters,lul_outputformat) 700 736 local lul_device = lul_parameters.device 737 701 738 local tmpl_params = { 702 739 header = html_header, … … 706 743 time = os.clock(), 707 744 } 708 local lul_js = lul_parameters.js 709 if( lul_js==nil or tonumber(lul_js)==0 ) then 710 lul_js = 0; 711 end 745 local lul_js = flag(lul_parameters.js) 712 746 tmpl_params.js = lul_js 747 g_is_remote = flag (lul_parameters.r) 748 749 local streamingurl = luup.variable_get ('urn:micasaverde-com:serviceId:Camera1', 'DirectStreamingURL', lul_device) 750 if streamingurl and g_is_remote=='1' then 751 streamingurl = string.format('data_request?id=lu_camera_port&DeviceNum=%d', lul_device) 752 end 753 tmpl_params.url = streamingurl or ("data_request?id=cam_image&Device_Num={%device%}&room={%room%}&time={%time%}"):template(tmpl_params) 754 713 755 714 756 if( lul_js=='1' ) then 715 757 return ([[ 716 %{header}%717 <div id="toolbar" class="toolbar"> <a href="data_request?id=lr_sPhone_room&room= %{room}%&time=%{time}%"><img src="/port_3480/L_sPhoneUI_layout/images/backButton.gif" border="0"></a> </div>758 {%header%} 759 <div id="toolbar" class="toolbar"> <a href="data_request?id=lr_sPhone_room&room={%room%}&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/images/backButton.gif" border="0"></a> </div> 718 760 <div align="center">View camera <br/> 719 <img src=" data_request?id=cam_image&Device_Num=%{device}%&room=%{room}%&time=%{time}%" id="view_%{device}%"><br>720 <img src=" /port_3480/L_sPhoneUI_layout/images/spacer.gif" border="0" width="20" height="20" id="action_icon_%{device}%"><br>721 <a href="javascript:void(0)" onClick="sp_move_camera( %{device}%,'MoveUp');"><img src="/port_3480/L_sPhoneUI_layout/images/buupdeasupra.gif" border="0"></a>722 <a href="javascript:void(0)" onClick="sp_move_camera( %{device}%,'MoveDown');"><img src="/port_3480/L_sPhoneUI_layout/images/budowndeasupra.gif" border="0"></a>723 <a href="javascript:void(0)" onClick="sp_move_camera( %{device}%,'MoveLeft');"><img src="/port_3480/L_sPhoneUI_layout/images/buldeasupra.gif" border="0"></a>724 <a href="javascript:void(0)" onClick="sp_move_camera( %{device}%,'MoveRight');"><img src="/port_3480/L_sPhoneUI_layout/images/burdeasupra.gif" border="0"></a>725 <a href="javascript:void(0)" onClick="sp_move_camera( %{device}%,'ZoomIn');"><img src="/port_3480/L_sPhoneUI_layout/images/buplusdeasupra.gif" border="0"></a>726 <a href="javascript:void(0)" onClick="sp_move_camera( %{device}%,'ZoomOut');"><img src="/port_3480/L_sPhoneUI_layout/images/buminusdeasupra.gif" border="0"></a>727 <br><a href="data_request?id=lr_sPhone_camimg&device= %{device}%&js=%{js}%&time=%{time}%&js=%{js}%">Refresh</a>728 %{footer}%729 ]]):template (tmpl_params) 730 else 731 return ([[ 732 <div id="toolbar" class="toolbar"> <a href="data_request?id=lr_sPhone_room&room= %{room}%&time=%{time}%"><img src="/port_3480/L_sPhoneUI_layout/images/backButton.gif" border="0"></a> </div>761 <img src="{%url%}" id="view_{%device%}"><br> 762 <img src="{%sPh_LAYOUT_PFX%}/images/spacer.gif" border="0" width="20" height="20" id="action_icon_{%device%}"><br> 763 <a href="javascript:void(0)" onClick="sp_move_camera({%device%},'MoveUp');"><img src="{%sPh_LAYOUT_PFX%}/images/buupdeasupra.gif" border="0"></a> 764 <a href="javascript:void(0)" onClick="sp_move_camera({%device%},'MoveDown');"><img src="{%sPh_LAYOUT_PFX%}/images/budowndeasupra.gif" border="0"></a> 765 <a href="javascript:void(0)" onClick="sp_move_camera({%device%},'MoveLeft');"><img src="{%sPh_LAYOUT_PFX%}/images/buldeasupra.gif" border="0"></a> 766 <a href="javascript:void(0)" onClick="sp_move_camera({%device%},'MoveRight');"><img src="{%sPh_LAYOUT_PFX%}/images/burdeasupra.gif" border="0"></a> 767 <a href="javascript:void(0)" onClick="sp_move_camera({%device%},'ZoomIn');"><img src="{%sPh_LAYOUT_PFX%}/images/buplusdeasupra.gif" border="0"></a> 768 <a href="javascript:void(0)" onClick="sp_move_camera({%device%},'ZoomOut');"><img src="{%sPh_LAYOUT_PFX%}/images/buminusdeasupra.gif" border="0"></a> 769 <br><a href="data_request?id=lr_sPhone_camimg&device={%device%}&js={%js%}&time={%time%}&r={%g_is_remote%}">Refresh</a> 770 {%footer%} 771 ]]):template (tmpl_params) 772 else 773 return ([[ 774 <div id="toolbar" class="toolbar"> <a href="data_request?id=lr_sPhone_room&room={%room%}&time={%time%}"><img src="{%sPh_LAYOUT_PFX%}/images/backButton.gif" border="0"></a> </div> 733 775 <div align="center">View camera <br/> 734 <img src=" data_request?id=cam_image&Device_Num=%{device}%&room=%{room}%&time=%{time}%"><br>735 <a href="data_request?id=lr_sPhone_action&room= %{room}%&device=%{device}%&service=urn:micasaverde-com:serviceId:PanTiltZoom1&action=MoveUp"><img src="/port_3480/L_sPhoneUI_layout/images/buupdeasupra.gif" border="0"></a>736 <a href="data_request?id=lr_sPhone_action&room= %{room}%&device=%{device}%&service=urn:micasaverde-com:serviceId:PanTiltZoom1&action=MoveDown"><img src="/port_3480/L_sPhoneUI_layout/images/budowndeasupra.gif" border="0"></a>737 <a href="data_request?id=lr_sPhone_action&room= %{room}%&device=%{device}%&service=urn:micasaverde-com:serviceId:PanTiltZoom1&action=MoveLeft"><img src="/port_3480/L_sPhoneUI_layout/images/buldeasupra.gif" border="0"></a>738 <a href="data_request?id=lr_sPhone_action&room= %{room}%&device=%{device}%&service=urn:micasaverde-com:serviceId:PanTiltZoom1&action=MoveRight"><img src="/port_3480/L_sPhoneUI_layout/images/burdeasupra.gif" border="0"></a>739 <a href="data_request?id=lr_sPhone_action&room= %{room}%&device=%{device}%&service=urn:micasaverde-com:serviceId:PanTiltZoom1&action=ZoomIn"><img src="/port_3480/L_sPhoneUI_layout/images/buplusdeasupra.gif" border="0"></a>740 <a href="data_request?id=lr_sPhone_action&room= %{room}%&device=%{device}%&service=urn:micasaverde-com:serviceId:PanTiltZoom1&action=ZoomOut"><img src="/port_3480/L_sPhoneUI_layout/images/buminusdeasupra.gif" border="0"></a>741 <br><a href="data_request?id=lr_sPhone_camimg&device= %{device}%&time=%{time}%&js=%{js}%">Refresh</a>776 <img src="{%url%}"><br> 777 <a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:micasaverde-com:serviceId:PanTiltZoom1&action=MoveUp"><img src="{%sPh_LAYOUT_PFX%}/images/buupdeasupra.gif" border="0"></a> 778 <a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:micasaverde-com:serviceId:PanTiltZoom1&action=MoveDown"><img src="{%sPh_LAYOUT_PFX%}/images/budowndeasupra.gif" border="0"></a> 779 <a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:micasaverde-com:serviceId:PanTiltZoom1&action=MoveLeft"><img src="{%sPh_LAYOUT_PFX%}/images/buldeasupra.gif" border="0"></a> 780 <a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:micasaverde-com:serviceId:PanTiltZoom1&action=MoveRight"><img src="{%sPh_LAYOUT_PFX%}/images/burdeasupra.gif" border="0"></a> 781 <a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:micasaverde-com:serviceId:PanTiltZoom1&action=ZoomIn"><img src="{%sPh_LAYOUT_PFX%}/images/buplusdeasupra.gif" border="0"></a> 782 <a href="data_request?id=lr_sPhone_action&room={%room%}&device={%device%}&service=urn:micasaverde-com:serviceId:PanTiltZoom1&action=ZoomOut"><img src="{%sPh_LAYOUT_PFX%}/images/buminusdeasupra.gif" border="0"></a> 783 <br><a href="data_request?id=lr_sPhone_camimg&device={%device%}&time={%time%}&js={%js%}&r={%g_is_remote%}">Refresh</a> 742 784 ]]):template (tmpl_params) 743 785 end … … 747 789 function lug_sPhoneRequest_room(lul_request,lul_parameters,lul_outputformat) 748 790 local lul_room = lul_parameters.room 749 local lul_js = lul_parameters.js 750 if( lul_js==nil or tonumber(lul_js)==0 ) then 751 lul_js = 0; 752 end 753 754 luup.log("lul_js = " .. lul_js) 791 local lul_js = flag(lul_parameters.js) 792 g_is_remote = flag (lul_parameters.r) 793 -- if( lul_js==nil or tonumber(lul_js)==0 ) then 794 -- lul_js = 0; 795 -- end 796 797 luup.log("lul_js = " .. tostring(lul_js)) 755 798 756 799 if( lul_room==nil or tonumber(lul_room)==0 ) then -- Room 0 means the main menu … … 765 808 766 809 local lul_html = {html_header, ([[ 767 <div id="toolbar" class="toolbar"> <div class="b_left"><a href="data_request?id=lr_sPhone"><img src=" /port_3480/L_sPhoneUI_layout/images/backButton.gif" border="0"></a></div> <div align="right" class="b_right"><a href="data_request?id=lr_sPhone_room&room=%{room}%&time=%{time}%&js=%{js}%"><img src="/port_3480/L_sPhoneUI_layout/images/refresh.gif" border="0"></a></div></div>810 <div id="toolbar" class="toolbar"> <div class="b_left"><a href="data_request?id=lr_sPhone"><img src="{%sPh_LAYOUT_PFX%}/images/backButton.gif" border="0"></a></div> <div align="right" class="b_right"><a href="data_request?id=lr_sPhone_room&room={%room%}&time={%time%}&js={%js%}&r={%g_is_remote%}"><img src="{%sPh_LAYOUT_PFX%}/images/refresh.gif" border="0"></a></div></div> 768 811 <ul title="Room" selected="true"> 769 812 ]]):template (tmpl_params)} … … 783 826 table.insert (lul_html, ([[ 784 827 <li class="bg"> 785 <a href="data_request?id=lr_sPhone_action&remote= %{remote}%&page=%{page}%&room=%{room}%&device=0&service=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=%{scene}%&time=%{time}%">786 <img src=" /port_3480/L_sPhoneUI_layout/buttons/go.gif" alt="" width="36" height="36" border="0" align="absmiddle" class="icon"/>828 <a href="data_request?id=lr_sPhone_action&remote={%remote%}&page={%page%}&room={%room%}&device=0&service=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum={%scene%}&time={%time%}"> 829 <img src="{%sPh_LAYOUT_PFX%}/buttons/go.gif" alt="" width="36" height="36" border="0" align="absmiddle" class="icon"/> 787 830 </a> 788 %{description}%831 {%description%} 789 832 </li> 790 833 ]]):template (tmpl_params)) … … 792 835 table.insert (lul_html, ([[ 793 836 <li class="bg"> 794 <img src=" /port_3480/L_sPhoneUI_layout/images/spacer.gif" border="0" width="20" height="20" id="scene_action_icon_%{scene}%" style="vertical-align:middle">795 <a href="javascript:void(0)" onClick="set_scene_icon( %{scene}%,1);sp_run_scene('data_request?id=lr_sPhone_action_js&remote=%{remote}%&page=%{page}%&room=%{room}%&device=0&service=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=%{scene}%&time=%{time}%',%{scene}%);">796 <img src=" /port_3480/L_sPhoneUI_layout/buttons/go.gif" alt="" width="36" height="36" border="0" style="vertical-align:middle" class="icon"/>837 <img src="{%sPh_LAYOUT_PFX%}/images/spacer.gif" border="0" width="20" height="20" id="scene_action_icon_{%scene%}" style="vertical-align:middle"> 838 <a href="javascript:void(0)" onClick="set_scene_icon({%scene%},1);sp_run_scene('data_request?id=lr_sPhone_action_js&remote={%remote%}&page={%page%}&room={%room%}&device=0&service=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum={%scene%}&time={%time%}',{%scene%});"> 839 <img src="{%sPh_LAYOUT_PFX%}/buttons/go.gif" alt="" width="36" height="36" border="0" style="vertical-align:middle" class="icon"/> 797 840 </a> 798 %{description}%841 {%description%} 799 842 </li> 800 843 ]]):template (tmpl_params)) … … 804 847 end 805 848 806 list_devices (lul_room, lul_html )849 list_devices (lul_room, lul_html, lul_js) 807 850 808 851 table.insert (lul_html, html_footer)
Note: See TracChangeset
for help on using the changeset viewer.