src/Door_accessory.js
changeset 11 a70d948427d3
parent 3 67f6a1e7c40a
child 22 00185499ed12
equal deleted inserted replaced
10:38c4094d0d57 11:a70d948427d3
    39 
    39 
    40     listenDoorbell: function(doorbellOnCallback, doorbellOffCallback) {
    40     listenDoorbell: function(doorbellOnCallback, doorbellOffCallback) {
    41         this.pyshell.on('message', function (message) {
    41         this.pyshell.on('message', function (message) {
    42             console.log(message);
    42             console.log(message);
    43             switch(message) {
    43             switch(message) {
    44             case 'doorbell_on':
    44             case 'doorbell on':
    45                 doorbellOnCallback();
    45                 doorbellOnCallback();
    46                 break;
    46                 break;
    47             case 'doorbell_off':
    47             case 'doorbell off':
    48                 doorbellOffCallback();
    48                 doorbellOffCallback();
    49                 break;
    49                 break;
    50             }
    50             }
    51         });
    51         });
    52     }
    52     }