@@ -2400,7 +2400,7 @@
ConsumedThing Examples
2400
2400
};
2401
2401
2402
2402
try {
2403
- // subscribe to property change for “ temperature”
2403
+ // subscribe to property change for " temperature"
2404
2404
await thing.observeProperty("temperature", async (data) => {
2405
2405
try {
2406
2406
console.log("Temperature changed to: " + await data.value());
@@ -2409,11 +2409,11 @@
ConsumedThing Examples
2409
2409
console.error(error);
2410
2410
}
2411
2411
});
2412
- // subscribe to the “ ready” event defined in the TD
2412
+ // subscribe to the " ready" event defined in the TD
2413
2413
await thing.subscribeEvent("ready", async (eventData) => {
2414
2414
try {
2415
2415
console.log("Ready; index: " + await eventData.value());
2416
- // run the “ startMeasurement” action defined by TD
2416
+ // run the " startMeasurement" action defined by TD
2417
2417
await thing.invokeAction("startMeasurement", { units: "Celsius" });
2418
2418
console.log("Measurement started.");
2419
2419
} catch (error) {
@@ -2432,7 +2432,7 @@
ConsumedThing Examples
2432
2432
console.log("Temperature: " + temperature);
2433
2433
2434
2434
await thing.unsubscribe("ready");
2435
- console.log("Unsubscribed from the ‘ ready’ event.");
2435
+ console.log("Unsubscribed from the ' ready' event.");
2436
2436
} catch (error) {
2437
2437
console.log("Error in the cleanup function");
2438
2438
}
@@ -2457,7 +2457,7 @@
ConsumedThing Examples
2457
2457
let response;
2458
2458
let image;
2459
2459
try {
2460
- response = await thing.invokeAction(“ takePicture”) );
2460
+ response = await thing.invokeAction(" takePicture" );
2461
2461
image = await response.value() // throws NotReadableError --> schema not defined
2462
2462
} catch(ex) {
2463
2463
image = await response.arrayBuffer();
@@ -2519,7 +2519,7 @@
ConsumedThing Examples
2519
2519
parser.on('data', data => data.name === 'startObject' && ++objectCounter);
2520
2520
parser.on('end', () => console.log(`Found ${objectCounter} objects.`));
2521
2521
2522
- const response = await thing.readProperty(“ eventHistory” )
2522
+ const response = await thing.readProperty(" eventHistory" )
2523
2523
await response.data.pipeTo(parser);
2524
2524
2525
2525
// Found N objects
@@ -4237,7 +4237,7 @@
API design rationale
4237
4237
and the < code > open()code > method are directly exposed on the object.
4238
4238
p >
4239
4239
< pre class ="example " title ="Open a lock with a simple API ">
4240
- let lock = await WoT.consume(‘ https://td.my.com/lock-00123’ );
4240
+ let lock = await WoT.consume(' https://td.my.com/lock-00123' );
4241
4241
console.log(lock.status);
4242
4242
lock.open('withThisKey');
4243
4243
pre >
@@ -4262,8 +4262,8 @@
API design rationale
4262
4262
let res = await fetch(‘https://td.my.com/lock-00123’);
4263
4263
let td = await res.json();
4264
4264
let lock = new ConsumedThing(td);
4265
- console.log(lock.readProperty(‘ status’ ));
4266
- lock.invokeAction(‘ open’ , 'withThisKey');
4265
+ console.log(lock.readProperty(' status' ));
4266
+ lock.invokeAction(' open' , 'withThisKey');
4267
4267
pre >
4268
4268
section >
4269
4269
< p >
0 commit comments