GithubHelp home page GithubHelp logo

copernicus's Introduction

copernicus

Library introducing simplified, high-level API for AGH Copernicus

How to

Coperniucs API is intented to let user operate on two objects: Request and Response

Request

Same as in normal Copernicus communication, the user is able to perform three operations: subsribe on events,query for current state parameters and set states.

Request object creation:

from copernicus import *

request = Copernicus.create_request()

Subscribe on event(s)

User can subscribe for the following events:

  • light
  • button1
  • button2
  • knob
  • temperature
  • motion

by performing simple method invocation on request:

request.subscribe_on(['button1', 'knob', 'light'])

Query for parameter(s)

User can query for the states of the same parameters as in subscription approach, by perfmoring querying method on request:

request.query_for_parameters(['button1', 'knob', 'light'])

Setting state

There are three parts of the Copernicus that we are able to set within the programm using the API:

  • led1
  • led2
  • dashboard.

Proper method call:

request.set_state('dashboard', 15)
request.set_state('led1', 2)

Response

Once we told the Request object what we want to acheive, we should send it in order to get the Response object.

response = Copernicus.send_request(request)

Resposne object will give the user to check on the states that were previously subscribed for/queried by the user.

response.get_state()
response.get_state()['light']

copernicus's People

Contributors

jakud avatar misqos avatar slagiewka avatar

Watchers

 avatar  avatar  avatar

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.