forked from hobbyquaker/homematic-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reganames.fn
executable file
·39 lines (30 loc) · 862 Bytes
/
reganames.fn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
!# reganames.fn 1.1 homematic-manager
!#
!# Dieses Homematic-Script gibt eine Liste aller Geraete-/Kanal-Namen als JSON String aus
!#
!# 5'2014 hobbyquaker https://github.com/hobbyquaker
!#
string sDevId;
string sChnId;
Write('{');
boolean dFirst = true;
foreach (sDevId, root.Devices().EnumUsedIDs()) {
object oDevice = dom.GetObject(sDevId);
object oChannel;
if (dFirst) {
dFirst = false;
} else {
WriteLine(',');
}
Write('"' # oDevice.Address() # '":{"ID":"' # oDevice.ID() # '","Name":"');
WriteURL(oDevice.Name());
Write('"}');
foreach(sChnId, oDevice.Channels()) {
oChannel = dom.GetObject(sChnId);
WriteLine(",");
Write('"' # oChannel.Address() # '":{"ID":"' # oChannel.ID() # '","Name":"');
WriteURL(oChannel.Name());
Write('"}');
}
}
Write('}');