-
Notifications
You must be signed in to change notification settings - Fork 28
Use schema, inputSchema, outputSchema from updated TD spec. Add support for TD links. #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Zoltan Kis <[email protected]>
index.html
Outdated
@@ -854,13 +854,13 @@ <h2>Examples</h2> | |||
thing.addProperty({ | |||
name: "temperature", | |||
value: "0", | |||
type: "number", | |||
schema: "number", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
must be schema: '{ "type": "number" }',
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Fixed.
index.html
Outdated
writable: false | ||
// use default values for the rest | ||
}); | ||
thing.addEvent({ | ||
name: "onchange", | ||
dataDescription: "number" | ||
schema: "number" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
must be schema: '{ "type": "number" }'
The examples must be changed from |
Signed-off-by: Zoltan Kis <[email protected]>
I am fine with the Having said that, the getLinks() updates are pretty new (not even sure if they make it into the TD for Prague) and I would rather split this PR into two and postpone the getLinks PR at the moment. |
Based on the discussions on today's calls, I have done the following changes:
|
… section. Add getProperties(), getActions(), getEvents(). Signed-off-by: Zoltan Kis <[email protected]>
See my two comments below..
In general PR looks good to go. |
This was agreed in the scripting call.
Actually the other way around, ThingPropertyInit was changed to ThingProperty (and similarly, Init was removed as suffix) in order to support the introspection methods in the experimental section. |
I'm ok to removing the SetName(). We can add again if TD define the corresponding spec. |
Yes, it was handy, but it should be clear whether is it a user settable name independent of the TD, or is it mandatory the TD exposes a I would not mind exposing Thing Properties directly on the |
There are some issues with this:
So, either we make Examples previously using So for the moment I suggest removing |
Signed-off-by: Zoltan Kis <[email protected]>
I have fixed the examples containing |
I did see your fix by using I think the fix should be something like the following
Once we (and if we) have ways to retrieve metadata from the thing there might be different ways to get this information. |
There is a lot of mixup here and the follow-up comment. We use capitalized "Property" for the Interaction Pattern, which requires sending a message (usually a GET request) to the Thing. These are different from JS/JSON properties.
So: metadata attributes and readible Properties are different. Attributes (lower case properties) on ConsumedThing would expose metadata, which is also contained in what I aim at having better introspection based on the simplified TD coming after Prague. It wpuld be similar to what was shown by Mozilla, e.g., let temp = await myThing.properties.temperature.read();
myThing.properties.setpoint.write(temp+5); |
So should the scripting API expose what you call the "TD metadata" (if TD wasn't metadata to start with)?
Also, is the
+1. By this we would reach the level of OCF APIs at least :). |
Signed-off-by: Zoltan Kis <[email protected]>
Discussed and approved on the Scripting call today. |
Following w3c/wot-thing-description#95
Fixes #94 and #89.
Signed-off-by: Zoltan Kis [email protected]