You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the thing description is generated in a separate class (hololinked.server.td.ThingDescription). However, it seems to be better to generate it in the handler of the affordance itself. In this way, it can also be accessed as an attribute of the affordance itself.
This will also help people define affordances and simply see what affordance schema is being generated.
For property and event, there are implementations called Property and Event. For actions, there is no such class.
Possibly involved steps
For property and event, create new method that returns the affordance schema
For the typed properties, decide where to place the specific data schema for each type
For actions, create a class/object Action with a __call__ which will handle the calling and a method that returns the schema.
There is a rough implementation in labthings-fastapi , it would useful to copy that once license details are sorted out.
The text was updated successfully, but these errors were encountered:
VigneshVSV
changed the title
Move TD generation to within the affordance objects
Move TD generation to within the affordance objects and support server side validation (with pydantic)
Jul 27, 2024
Currently the thing description is generated in a separate class (
hololinked.server.td.ThingDescription
). However, it seems to be better to generate it in the handler of the affordance itself. In this way, it can also be accessed as an attribute of the affordance itself.This will also help people define affordances and simply see what affordance schema is being generated.
For property and event, there are implementations called
Property
andEvent
. For actions, there is no such class.Possibly involved steps
Action
with a__call__
which will handle the calling and a method that returns the schema.There is a rough implementation in labthings-fastapi , it would useful to copy that once license details are sorted out.
The text was updated successfully, but these errors were encountered: