Listen for deviceChange and add new devices if new ones are created
This commit is contained in:
parent
f80f37dd18
commit
acdbbcc47b
1 changed files with 24 additions and 14 deletions
|
@ -26,6 +26,8 @@ com.telldus.schedulersimplegui = function() {
|
|||
deviceList.push(item);
|
||||
}
|
||||
view.setProperty('deviceModel', deviceList);
|
||||
//Listen for device-change
|
||||
com.telldus.core.deviceChange.connect(deviceChange);
|
||||
|
||||
//points:
|
||||
//from storage...
|
||||
|
@ -95,6 +97,14 @@ com.telldus.schedulersimplegui = function() {
|
|||
deviceList.push({name:'Stallet istallet'});
|
||||
}
|
||||
|
||||
function deviceChange( deviceId, eventType ) {
|
||||
if (eventType == com.telldus.core.TELLSTICK_DEVICE_ADDED) {
|
||||
var item = com.telldus.core.deviceList.getDevice(deviceId);
|
||||
item.isEnabled = "enabled";
|
||||
deviceList.push(item);
|
||||
}
|
||||
}
|
||||
|
||||
function getSun(riseset, rowWidth, pointWidth){
|
||||
var date = new Date();
|
||||
var timevalues = com.telldus.suncalculator.riseset(date);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue