Haiku HaikuHelper script remembering old code?

cantrels

New Member
I just started to explore the scripting features in HaikuHelper, and have run into an unusual situation:
 
My first script was:
 
function onZoneNotReady(zone)
    {
        if (zone.number == 49) // Driveway Sensor
            { helper.sendNotification (controller, 'Driveway Sensor Tripped'); }
            
        if (zone.number = 14) // West Hall Motion
                { controller.unitWithNumber(5).setOnForMinutes(2); }
    }
 
and this all worked as expected. When I someone pulls into the driveway, I got a push and when I walked in that particular hallway, the light came on for two minutes.
 
But then I decided not to use motion for the lighting, and instead check to see if the door in from the garage was not ready, so I rewrote the script to:
 
function onZoneNotReady(zone)
    {
        if (zone.number == 49) // Driveway Sensor
            { helper.sendNotification (controller, 'Driveway Sensor Tripped'); }
            
        if (zone.number = 2) // Garage Entry Door
                { controller.unitWithNumber(5).setOnForMinutes(2); }
    }
 
I then stopped the script, and then re-ran the script. However, the old script seems to be running still...the light comes on when the motion detector is tripped as well as when the garage door is opened.
 
Is there something I've missed that would clear out the old instruction so the motion sensor tripping isn't part of the active running script?
 
Thanks in advance!
 
 
It looks like the error is on this line:

if (zone.number = 2) // Garage Entry Door

The comparison should be == not = :)
 
Back
Top