Git Product home page Git Product logo

autohome's Introduction

AutoHome

AutoHome is a collection of smart devices and projects that integrate and work with one-another. (In the end, that is ;p)

ServerDevice:

  • State

Config-Layout /server/config.json { name: "ThuisWolk"

enabledServices: [
	...serviceIds
]


interface: {
	signInWithFloriswebKey,
	allowedUserIds: []
}

}

Service-Layout /server/services/ServiceId

  • /config.json
  • /interface /interface.jsx -> exports {panel, page}
  • /server /service.js -> export default: Service

Service.config.json { name: "" isDeviceService: (bool) -> false, - Whether or not the services represents an external entity (for example, true: a lamp, false: )
hasUI: (bool) -> false - enables the /interface directory

wants: [...serviceIds] -> []
requires: [...serviceIds] -> []


trackDownTime: (bool) -> false

subscriptions: [...serviceIds]

/* --- Custom Properties --- */


/* --- Homebridge Config --- for integration with the HomeBridgeService*/ 
HBConfig: { 

}

}

Client-protocol

Connecting and Authentication

  1. Client starts connection to websocketserver.

  2. OnConnect: Client sends auth message: {id: deviceId/serviceId, key} Special case, interfaceClient: {id: 'InterfaceClient', key: FloriswebAuthToken}

  3. Server Responses InterfaceClient: {"type": "auth", "status": true} {"type": "auth", "status": false, "error": "Invalid Key"}

    {error: "Parameters missing"} {error: "Invalid request"}

Message types

Push { type: (string) data: (any) serviceId }

Request Request: { requestId type: (string) data: (any) serviceId, } Response: { isResponse: true, requestId - request.requestId response: (any) - response }

Messages Default Format: { type: (string) data: (any) serviceId }

Request, extends Format: { ... requestId: (string) - internal usage }

SetStateByKey: [device -> server]

  • Sets a particular key's value on the servers object.
  • Request: { type: 'setStateByKey', stateKey: (string) data: (any) }

GetStateByKey: [server -> any]

  • Returns a particular key's value on the servers object.
  • Request: { type: 'getStateByKey', stateKey: (string) }

GetState: [server -> any]

  • Returns the current state on the servers object.
  • Request: { type: 'getState', }
  • Return: StateUpdate

CurState: [server -> any]

  • Request: { type: 'curState', data: state (any) }

servic.page.render() -> returns div.panelBox

autohome's People

Contributors

florisweb avatar

Watchers

 avatar

autohome's Issues

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.