Giter Site home page Giter Site logo

coatyio / coaty-examples Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 5.0 6.31 MB

A set of fully documented code examples that demonstrate best practices and typical usage patterns for Coaty applications.

Home Page: https://coaty.io

License: MIT License

Dockerfile 1.00% JavaScript 2.74% TypeScript 48.79% HTML 8.27% Swift 35.45% Ruby 0.40% Shell 0.11% SCSS 3.25%
coaty examples javascript swift typescript

coaty-examples's People

Contributors

dependabot[bot] avatar johannesrohwer avatar lukasz-zet avatar markussauer avatar melloskitten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

coaty-examples's Issues

Connection to DB

I tried to run the hello-world example (js) as specified in the README.md on my windows 10 laptop. I installed PostgreSQL 11 with the default username and password. The example runs as expected; however, I can't see the newly created DB (DB_NAME = "helloworld_db") on PGAdmin 4 UI nor on the SQL shell. I added shouldPersistLocalSnapshots: true; to the HistorianController and added the port on functions: getConnectionString() and getAdminConnectionString() (following this link) but still, the DB doesn't seem to be created.
My question is: do you have any idea why the DB is not created?

Discovering advertised Things

Affected example
[email protected]

Is your feature request related to a problem? Please describe.
I am using the example to create i) Things that advertise their description and observations and ii) a consumer agent that discovers advertised Things.
If I assume a situation where Things are running first, then the consumer agent is switched on, it can't detect already advertised Things.
Also, if I assume both Things and consumer agents are switched on, then one of the Things goes off and on again, the consumer agent considers it as a new sensor since it has a new UUID.

Describe the solution you'd like
Ideally, the consumer agent should keep track of newly registered Things, previously registered Things, and Things that are deregistered in order to have an updated status of Things available in the specific context at all times.

Describe alternatives you've considered
I used the sensor-things-controller.ts for creating Things
In the consumer agent, I used

this.registeredSensorsChangeInfo$.subscribe(changeInfo => {
            // changeInfo.added.forEach(sensor => this._dbCtx.insertObjects(Db.COLLECTION_SENSOR, sensor, true));
            // changeInfo.added.forEach(sensor => this._dbCtx.insertObjects(Db.COLLECTION_THING, sensor["thing"] as Thing, true));
            changeInfo.changed.forEach(sensor => console.log("changed Thing: ", sensor["thing"] as Thing));
            changeInfo.added.forEach(sensor => console.log("New Thing: ", sensor["thing"] as Thing));
            changeInfo.removed.forEach(sensor => console.log("Removed Thing:  ", sensor["thing"] as Thing));
        });

But this doesn't seem to solve it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.