GetDevice

This procedure was deprecated in HomeSeer 2.0.0.0 - please use GetDeviceRef instead.

Purpose

This function will return a reference to a specific device.  The function returns a reference to a DeviceClass object (see below).  The object is what HomeSeer uses internally to represent a device.  With this object you can set and get all properties of a device.

Parameters

Parameter: index
Type: integer
Description: This is the index in the device list of the device you wish to retrieve.  You can use the DeviceCount function to retrieve the total number of devices that have been configured.  The GetDeviceEx function can also be used to get a reference to a device using it's name.

Returns

Return value: DeviceClass
Type: object
Description: This is a reference to a device object of type DeviceClass.

Warning:

This script call is provided for backward compatibility with version 1.X of HomeSeer. It is recommended that scripts be updated to use the new GetDeviceEnumerator call to enumerate through devices, or use the GetDeviceByRef and use the device reference number rather than the index. Using the index may fail since device indexes may change due to the multi-threaded nature of HomeSeer 2. See the GetDeviceByRef function for an example.