Skip to content
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

Refactor: new api #13

Open
hidaris opened this issue Dec 9, 2021 · 0 comments
Open

Refactor: new api #13

hidaris opened this issue Dec 9, 2021 · 0 comments
Assignees
Milestone

Comments

@hidaris
Copy link
Owner

hidaris commented Dec 9, 2021

  1. Thing => ExposedThing
  2. add CosumedThing
  3. add Servient to support ExposedThing and CosumedThing
  4. move thing container to Sevient

example:

servient = Servient()
servient.addServer(
    HttpServer({
        port: 8081
    })
)


wot = await servient.start()

thing = wot.produce({
        "@context": "https://www.w3.org/2019/wot/td/v1",
        title: "MyCounter",
        properties: {
            count: {
                type: "integer",
            },
        },
    })

logger.info("Produced " + thing.getThingDescription().title)
thing.writeProperty("count", 0)

await thing.expose()
            
logger.info(thing.getThingDescription().title + " ready")
logger.info("TD : " + json.dumps(thing.getThingDescription()))
        
c = thing.readProperty("count")
logger.info("cound is " + c)
@hidaris hidaris pinned this issue Dec 9, 2021
@hidaris hidaris added this to the v1.0 milestone Dec 10, 2021
@hidaris hidaris self-assigned this Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant