File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 140140 }
141141 },
142142 "short_name" : " Virtual" ,
143- "version" : " 0.7.1 "
143+ "version" : " 0.7.2 "
144144}
Original file line number Diff line number Diff line change 11{
22 "name" : " virtual-things-adapter" ,
33 "display_name" : " Virtual Things" ,
4- "version" : " 0.7.1 " ,
4+ "version" : " 0.7.2 " ,
55 "description" : " Mozilla WebThings Gateway Virtual Things Adapter" ,
66 "main" : " index.js" ,
77 "scripts" : {
Original file line number Diff line number Diff line change @@ -107,14 +107,15 @@ function on() {
107107 } ;
108108}
109109
110- function color ( ) {
110+ function color ( readOnly = false ) {
111111 return {
112112 name : 'color' ,
113113 value : '#ffffff' ,
114114 metadata : {
115115 title : 'Color' ,
116116 type : 'string' ,
117117 '@type' : 'ColorProperty' ,
118+ readOnly,
118119 } ,
119120 } ;
120121}
@@ -911,6 +912,17 @@ const lock = {
911912 events : [ ] ,
912913} ;
913914
915+ const colorSensor = {
916+ '@context' : 'https://iot.mozilla.org/schemas' ,
917+ '@type' : [ 'ColorSensor' ] ,
918+ name : 'Virtual Color Sensor' ,
919+ properties : [
920+ color ( true ) ,
921+ ] ,
922+ actions : [ ] ,
923+ events : [ ] ,
924+ } ;
925+
914926if ( ffmpegMajor !== null && ffmpegMajor >= 4 ) {
915927 videoCamera . properties [ 0 ] . metadata . links . push ( {
916928 rel : 'alternate' ,
@@ -946,6 +958,7 @@ const VIRTUAL_THINGS = [
946958 colorControl ,
947959 thermostat ,
948960 lock ,
961+ colorSensor ,
949962] ;
950963
951964/**
You can’t perform that action at this time.
0 commit comments