DeviceTypeInfo Object
Purpose
The DeviceType object (DeviceTypeInfo) is accessed directly from the device class object using the _Get and _Set properties. When a change is made to the DeviceTypeInfo object, _Set must be called to post the change to the device, and then hs.SaveEventsDevices should be called to force HomeSeer to save the device change.
Parameters
The prototype for the class is:
Public Class DeviceTypeInfo
Public Property Device_API As eDeviceAPI
Public ReadOnly Property Device_API_Description As String
Public Property Device_Type As Integer
Public ReadOnly Property Device_Type_Description As String
Public Property Device_SubType As Integer
Public Property Device_SubType_Description As String
End Class
Returns
Nothing
Example
Sample Code
Retrieve the DeviceTypeInfo object:
Dim DT as DeviceAPI.DeviceTypeInfo = Nothing
' The device has a reference ID of 1234
dv = hs.GetDeviceByRef(1234)
DT = dv.DeviceType_Get(hs)
If DT IsNot Nothing Then
...
End If
Change the DeviceTypeInfo and Save the change
Dim DT As DeviceAPI.DeviceTypeInfo = Nothing
Dim dv As Scheduler.Classes.DeviceClass = Nothing
' The device has a reference ID of 1234
dv = hs.GetDeviceByRef(1234)
If dv Is Nothing Then .... (log an error and exit the procedure)
DT = dv.DeviceType_Get(hs)
If DT IsNot Nothing Then
DT.Device_API = DeviceAPI.DeviceTypeInfo.eDeviceAPI.Plug_In
dv.DeviceType_Set(hs) = DT
hs.SaveEventsDevices
End If