Skip to content

Commit 6854ab7

Browse files
Merge pull request #357 from danielpeintner/revert-pr-328
fix: revert pr #328 for v0.7.x
2 parents aa1cf8c + 763188b commit 6854ab7

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

packages/core/src/exposed-thing.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,10 @@ export default class ExposedThing extends TD.Thing implements WoT.ExposedThing {
161161
readProperty(propertyName: string, options?: WoT.InteractionOptions): Promise<any> {
162162
return new Promise<any>((resolve, reject) => {
163163
if (this.properties[propertyName]) {
164-
if(this.properties[propertyName].writeOnly && this.properties[propertyName].writeOnly === true) {
164+
// writeOnly check skipped so far, see https://github.com/eclipse/thingweb.node-wot/issues/333#issuecomment-724583234
165+
/* if(this.properties[propertyName].writeOnly && this.properties[propertyName].writeOnly === true) {
165166
reject(new Error(`ExposedThing '${this.title}', property '${propertyName}' is writeOnly`));
166-
}
167+
} */
167168

168169
let ps: PropertyState = this.properties[propertyName].getState();
169170
// call read handler (if any)
@@ -227,9 +228,10 @@ export default class ExposedThing extends TD.Thing implements WoT.ExposedThing {
227228
writeProperty(propertyName: string, value: any, options?: WoT.InteractionOptions): Promise<void> {
228229
return new Promise<void>((resolve, reject) => {
229230
if (this.properties[propertyName]) {
230-
if (this.properties[propertyName].readOnly && this.properties[propertyName].readOnly === true) {
231+
// readOnly check skipped so far, see https://github.com/eclipse/thingweb.node-wot/issues/333#issuecomment-724583234
232+
/* if (this.properties[propertyName].readOnly && this.properties[propertyName].readOnly === true) {
231233
reject(new Error(`ExposedThing '${this.title}', property '${propertyName}' is readOnly`));
232-
}
234+
} */
233235

234236
let ps: PropertyState = this.properties[propertyName].getState();
235237

packages/core/test/ServerTest.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ class WoTServerTest {
145145
}
146146
}
147147

148-
@test async "should not be able to read property with writeOnly"() {
148+
// skipped so far, see https://github.com/eclipse/thingweb.node-wot/issues/333#issuecomment-724583234
149+
@test.skip async "should not be able to read property with writeOnly"() {
149150
let thing = await WoTServerTest.WoT.produce({
150151
title: "ThingWithWriteOnly",
151152
properties: {
@@ -169,7 +170,8 @@ class WoTServerTest {
169170
}
170171
}
171172

172-
@test async "should not be able to write property with readOnly"() {
173+
// skipped so far, see https://github.com/eclipse/thingweb.node-wot/issues/333#issuecomment-724583234
174+
@test.skip async "should not be able to write property with readOnly"() {
173175
let thing = await WoTServerTest.WoT.produce({
174176
title: "ThingWithReadOnly",
175177
properties: {

0 commit comments

Comments
 (0)