()
| 17 | } = require('webthing'); |
| 18 | |
| 19 | function makeThing() { |
| 20 | const thing = new Thing('urn:dev:ops:my-actuator-1234', |
| 21 | 'ActuatorExample', |
| 22 | ['OnOffSwitch'], |
| 23 | 'An actuator example that just log'); |
| 24 | |
| 25 | thing.addProperty( |
| 26 | new Property(thing, |
| 27 | 'on', |
| 28 | new Value(true, (update) => console.log(`change: ${update}`)), |
| 29 | { |
| 30 | '@type': 'OnOffProperty', |
| 31 | title: 'On/Off', |
| 32 | type: 'boolean', |
| 33 | description: 'Whether the output is changed', |
| 34 | })); |
| 35 | return thing; |
| 36 | } |
| 37 | |
| 38 | function runServer() { |
| 39 | const port = process.argv[2] ? Number(process.argv[2]) : 8888; |
no test coverage detected