/**
* Parses the device informations into the binding model.
*/
@SuppressWarnings("unchecked")
private HmDevice parseDevice(Map<String, ?> deviceData) throws IllegalAccessException {
HmDevice device = new HmDevice();
FieldUtils.writeField(device, "address", deviceData.get("ADDRESS"), true);
FieldUtils.writeField(device, "type", deviceData.get("TYPE"), true);
FieldUtils.writeField(device, "hmInterface", HmInterface.HOMEGEAR, true);
Object[] channelList = (Object[]) deviceData.get("CHANNELS");
for (int i = 0; i < channelList.length; i++) {
Map<String, ?> channelData = (Map<String, ?>) channelList[i];
device.addChannel(parseChannel(device, channelData));
}
return device;
}