Skip to content

Commit 72a5b34

Browse files
committed
Add occupancy sensor - closes #73
1 parent f2bbcac commit 72a5b34

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

virtual-things-adapter.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,26 @@ const motionSensor = {
417417
events: [],
418418
};
419419

420+
const occupancySensor = {
421+
'@context': 'https://webthings.io/schemas',
422+
'@type': ['OccupancySensor'],
423+
name: 'Virtual Occupancy Sensor',
424+
properties: [
425+
{
426+
name: 'occupied',
427+
value: false,
428+
metadata: {
429+
title: 'Occupied',
430+
type: 'boolean',
431+
'@type': 'OccupiedProperty',
432+
readOnly: true,
433+
},
434+
},
435+
],
436+
actions: [],
437+
events: [],
438+
};
439+
420440
const leakSensor = {
421441
'@context': 'https://webthings.io/schemas',
422442
'@type': ['LeakSensor'],
@@ -1120,6 +1140,7 @@ const VIRTUAL_THINGS = [
11201140
airQualitySensor,
11211141
barometricPressureSensor,
11221142
smokeSensor,
1143+
occupancySensor,
11231144
];
11241145

11251146
/**

0 commit comments

Comments
 (0)