Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For example, for a ThermostatDevice, you could interact with it as follows:

Code Block
languagejava
titleThermostatDevice API
linenumberstrue
final Device d = gw.getDevice(id);
if (d instanceof ThermostatDevice) {
	final ThermostatDevice device = (ThermostatDevice) d;
	device.readMode();
	device.changeMode(SystemMode.AUTO);
} else {
	System.out.println("device is not a thermostat");
}

...