Is it possible to programmatically change an existing device’s ‘typeName’?
I would like to allow a user to determine the deviceType of an existing child device, that was previously created with the same SmartApp. Both deviceTypes exist in the users “My Device Handlers”.
I already tried using the following code (deviceID is the DNI is the child device):
device = getChildDevice(deviceId)
device.name == “New Device Name” // Successful
device.label == “New Label Name” // Successful
device.typeName == “Name of a Valid DTH” // UNSuccessful: Does not work or generate any error
This code does not generate an error, but it does not change the typeName of the device. I can change the label and name of a child device, but it appears that changing the typeName is restricted? BTW, executing device.typeName == Name of a Baseball Player does not generate an error either. So what am I missing here?
Ultimately, I want to allow the user to select from a defined list of DTH’s a:
- DTH with background tile colors ON
- DTH with background tile colors OFF (Android users have issues displaying some tiles with background colors)