I want to move a very simple piece of code from VB to C#. I found numerous samples in the forum but all failed with different errors.
This is the code:
Sub Main(Parm As Object)
Dim DE, dv
'Get a list of devices
DE = hs.GetDeviceEnumerator
If DE is nothing then
hs.Writelog("Info", "No thermostats")
end if
Do while Not DE.Finished
dv = DE.GetNext ' DV is van het type DeviceClass en bevast alle informatie over het device
hs.Writelog("Interface", dv.Interface(hs))
Loop
End Sub
Can someone help me to put this into a working C# script (maybe including 'using' statements).
Thanks in advance!
Kees
Current Date/Time: 03-Oct-17 4:57:13 PM
HomeSeer Version: HS3 Pro Edition 3.0.0.362
Operating System: Microsoft Windows 10 Enterprise 2015 LTSB - Work Station
System Uptime: 13 Days 10 Hours 10 Minutes 44 Seconds
IP Address: 192.168.253.161
Number of Devices: 362
Number of Events: 83
Available Threads: 400
Enabled Plug-Ins
2.0.35.0: BLLAN
3.0.0.10: P1
30.0.0.35: RFXCOM
1.0.0.6: Sample Plugin
1.2.2.0: SceneMaster
3.0.0.21: Sonos
3.0.1.144: Z-Wave
This is the code:
Sub Main(Parm As Object)
Dim DE, dv
'Get a list of devices
DE = hs.GetDeviceEnumerator
If DE is nothing then
hs.Writelog("Info", "No thermostats")
end if
Do while Not DE.Finished
dv = DE.GetNext ' DV is van het type DeviceClass en bevast alle informatie over het device
hs.Writelog("Interface", dv.Interface(hs))
Loop
End Sub
Can someone help me to put this into a working C# script (maybe including 'using' statements).
Thanks in advance!
Kees
Current Date/Time: 03-Oct-17 4:57:13 PM
HomeSeer Version: HS3 Pro Edition 3.0.0.362
Operating System: Microsoft Windows 10 Enterprise 2015 LTSB - Work Station
System Uptime: 13 Days 10 Hours 10 Minutes 44 Seconds
IP Address: 192.168.253.161
Number of Devices: 362
Number of Events: 83
Available Threads: 400
Enabled Plug-Ins
2.0.35.0: BLLAN
3.0.0.10: P1
30.0.0.35: RFXCOM
1.0.0.6: Sample Plugin
1.2.2.0: SceneMaster
3.0.0.21: Sonos
3.0.1.144: Z-Wave
Comment