@@ -43,38 +43,44 @@ WoT.produce({
4343 title : "TestThing" ,
4444 properties : {
4545 bool : {
46- title : "true/false" ,
46+ title : "Boolean" ,
47+ description : "Property that can be set to true or false" ,
4748 type : "boolean" ,
4849 } ,
4950 int : {
50- title : "Integer number" ,
51+ title : "Integer" ,
52+ description : "An integer value that can be read and written" ,
5153 type : "integer" ,
5254 } ,
5355 num : {
54- title : "Floating point" ,
56+ title : "Number" ,
57+ description : "A floating point value that can be read and written" ,
5558 type : "number" ,
5659 } ,
5760 string : {
61+ title : "String" ,
62+ description : "A string value that can be read and written" ,
5863 type : "string" ,
5964 } ,
6065 array : {
61- title : "Tuple" ,
66+ title : "Array" ,
67+ description : "An Array (List) with no structure that can be read and written" ,
6268 type : "array" ,
6369 items : { } ,
6470 } ,
6571 object : {
66- title : "ID-name " ,
67- description : "Object with ID and name" ,
72+ title : "Object " ,
73+ description : "An object with id and name that can be read and written " ,
6874 type : "object" ,
6975 properties : {
7076 id : {
7177 title : "ID" ,
72- description : "Internal identifier" ,
78+ description : "Integer identifier" ,
7379 type : "integer" ,
7480 } ,
7581 name : {
7682 title : "Name" ,
77- description : "Public name " ,
83+ description : "Name associated to the identifier " ,
7884 type : "string" ,
7985 } ,
8086 } ,
@@ -137,18 +143,33 @@ WoT.produce({
137143 } ,
138144 events : {
139145 "on-bool" : {
140- title : "on-bool Event " ,
141- description : "Event with boolean data" ,
146+ title : "Bool Property Change " ,
147+ description : "Event with boolean data that is emitted when the bool property is written to " ,
142148 data : { type : "boolean" } ,
143149 } ,
144150 "on-int" : {
145- title : "on-int Event " ,
146- description : "Event with integer data" ,
151+ title : "Int Property Change " ,
152+ description : "Event with integer data that is emitted when the int property is written to " ,
147153 data : { type : "integer" } ,
148154 } ,
149155 "on-num" : {
150- title : "on-num Event" ,
151- description : "Event with number data" ,
156+ title : "Num Property Change" ,
157+ description : "Event with number data that is emitted when the num property is written to" ,
158+ data : { type : "number" } ,
159+ } ,
160+ "on-string" : {
161+ title : "String Property Change" ,
162+ description : "Event with number data that is emitted when the string property is written to" ,
163+ data : { type : "number" } ,
164+ } ,
165+ "on-array" : {
166+ title : "Array Property Change" ,
167+ description : "Event with number data that is emitted when the array property is written to" ,
168+ data : { type : "number" } ,
169+ } ,
170+ "on-object" : {
171+ title : "Object Property Change" ,
172+ description : "Event with number data that is emitted when the object property is written to" ,
152173 data : { type : "number" } ,
153174 } ,
154175 } ,
@@ -187,6 +208,7 @@ WoT.produce({
187208 const localString = await value . value ( ) ;
188209 checkPropertyWrite ( "string" , typeof localString ) ;
189210 string = localString as string ;
211+ thing . emitEvent ( "on-string" , string ) ;
190212 } )
191213 . setPropertyReadHandler ( "string" , async ( ) => string )
192214 . setPropertyWriteHandler ( "array" , async ( value ) => {
@@ -197,6 +219,7 @@ WoT.produce({
197219 checkPropertyWrite ( "array" , typeof localArray ) ;
198220 }
199221 array = localArray as unknown [ ] ;
222+ thing . emitEvent ( "on-array" , array ) ;
200223 } )
201224 . setPropertyReadHandler ( "array" , async ( ) => array )
202225 . setPropertyWriteHandler ( "object" , async ( value ) => {
@@ -207,6 +230,7 @@ WoT.produce({
207230 checkPropertyWrite ( "object" , typeof localObject ) ;
208231 }
209232 object = localObject as Record < string , unknown > ;
233+ thing . emitEvent ( "on-object" , object ) ;
210234 } )
211235 . setPropertyReadHandler ( "object" , async ( ) => object ) ;
212236
0 commit comments