Closed florian-h05 closed 2 years ago
Closes #89.
Thing
getThings
getThing
DO NOT USE ON PRODUCTION AS THIS MODIFIES A THING!!
const { things } = require('openhab'); const allThings = things.getThings(); console.info(allThings); const astroThing = things.getThing('astro:moon:e66c230447', true); console.info(astroThing); const thing = allThings[0]; function analyzeThing (thing) { console.info('Bridge UID: ' + thing.bridgeUID); console.info('Thing label: ' + thing.label); console.info('Thing location: ' + thing.location); console.info('Thing sttaus: ' + thing.status); console.info('Thing detailed status: ' + thing.statusInfo); console.info('ThingTypeUID: ' + thing.thingTypeUID); console.info('Thing UID: ' + thing.uid); console.info('Thing is enabled: ' + thing.isEnabled); } analyzeThing(thing); thing.setLabel('new label'); thing.setLocation('living room'); thing.setEnabled(false); analyzeThing(thing);
Closes #89.
Improvements
Thing
class which represents an openHAB Thing, that e.g. holds the label, but also allows to set the enabled stategetThings
to get an Array of all openHAB ThingsgetThing
to get a single ThingTesting
DO NOT USE ON PRODUCTION AS THIS MODIFIES A THING!!