Jump to content


Photo
- - - - -

Flag email


  • Please log in to reply
36 replies to this topic

#31 heffneil

heffneil

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 296 posts

Posted 23 April 2012 - 10:14 PM

I think I have - well I know I have the same function name twice. That can't be good can it?

#32 lupinglade

lupinglade

    Cocoonut

  • Manufacturers
  • PipPipPipPip
  • 1085 posts
  • Experience:guru
  • Software:Custom
  • Hardware:HAI OmniPro II
  • Tech:UPB, ZigBee, Custom
  • Audio:Nuvo
  • Video:AirPlay
  • CCTV:ip, dvr
  • Phone:Linksys PAP2, Vonage

Posted 23 April 2012 - 11:06 PM

Nope, you can only have it once :) Otherwise only one of them gets called.

#33 lupinglade

lupinglade

    Cocoonut

  • Manufacturers
  • PipPipPipPip
  • 1085 posts
  • Experience:guru
  • Software:Custom
  • Hardware:HAI OmniPro II
  • Tech:UPB, ZigBee, Custom
  • Audio:Nuvo
  • Video:AirPlay
  • CCTV:ip, dvr
  • Phone:Linksys PAP2, Vonage

Posted 23 April 2012 - 11:08 PM

If you need to have the same function do multiple things, you have to define this function somewhere central and have logic to make it do what you want when you want.

#34 heffneil

heffneil

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 296 posts

Posted 24 April 2012 - 07:03 AM

I combined them last night but now I get an error:

Apr 24/12 8:01 AM: Home: Unhandled exception in script on line: 4 in function onSyncStart: Can't find variable: now


function onSyncStart(forced, timestamp) {
if(!isCollectingEvents) collectEvents();

helper.log(controller, 'Started sync at ' + now.getHours() + ':' + now.getMinutes());
var date = new Date(timestamp);


if(date.getHours() == 23 && date.getMinutes() == 19) {
sendPoolMeterReport();
poolMeterDay = 0;
if(date.getDay() == 0) poolMeterWeek = 0;
}
}

#35 lupinglade

lupinglade

    Cocoonut

  • Manufacturers
  • PipPipPipPip
  • 1085 posts
  • Experience:guru
  • Software:Custom
  • Hardware:HAI OmniPro II
  • Tech:UPB, ZigBee, Custom
  • Audio:Nuvo
  • Video:AirPlay
  • CCTV:ip, dvr
  • Phone:Linksys PAP2, Vonage

Posted 24 April 2012 - 12:48 PM

Replace
 helper.log(controller, 'Started sync at ' + now.getHours() + ':' + now.getMinutes());

with

helper.log(controller, 'Started sync at ' + date.getHours() + ':' + date.getMinutes());


#36 heffneil

heffneil

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 296 posts

Posted 24 April 2012 - 05:11 PM

I commented the line out and it appears that the mailer still isn't working :( Can I email you the entire script so you can take a look?

#37 lupinglade

lupinglade

    Cocoonut

  • Manufacturers
  • PipPipPipPip
  • 1085 posts
  • Experience:guru
  • Software:Custom
  • Hardware:HAI OmniPro II
  • Tech:UPB, ZigBee, Custom
  • Audio:Nuvo
  • Video:AirPlay
  • CCTV:ip, dvr
  • Phone:Linksys PAP2, Vonage

Posted 24 April 2012 - 11:49 PM

Sure.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users