adrianjost / SmartLight-Web-Client

SmartLight Client based on Google firebase

Home Page:http://app.smartlight.hackedit.de

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SmartLight Web

CI Codacy Badge Dependency Status Dependency Status

This Repository contains the (Web-) UI for SmartLight as well as the Firebase hosted Backend Code.

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

# deploy to firebase
npm deploy

For detailed explanation on how things work, checkout the guide and docs for vue-loader.

Environment Variables

Variable Description
VUE_APP_SENTRY_DSN SENTRY DSN URL - if defined, sentry is enabled and will report all errors

Database

Schema

All Objects that are defined here will be explained in detail below. This is just an overview.

{
  users: {UserObject, ...},
  units: {UnitObject ...},
  states: {StateObject, ...},
}

UserObject

$userId: {
  apiSeret: String,
}

The apiSecret will be used for external API access like used for Google Home integration (via IFTTT).

Units

Units are Items that can be controlled. Such Items can eighter be lamps or groups of lamps. The base Schema is the following and will be extended for lamps/groups with a couple more key-value pairs.

$index: {
  created_by: userId,
  //allowedUsers: [userId, ...],

  type: ENUM["LAMP", "GROUP"],
  lamptype: String, // ["RGB", "WWCW"]

  id: String,
  name: String,
  icon: String,

  state: { // only one child at a time allowed
    color: String, // #aabbcc
    type: String // ["OFF", "MANUAL", "AUTO"]
  }
}
extension for lamps
{
  ...
  ip: String,
  hostname: String,
  channelMap: Object,
}
  • lamptype: RGB, WWCW, Switch ...
  • channelMap: { r: 1, g: 2, b: 3} with 1, 2 and 3 mixed up
extension for groups
{
  ...
  lamps: [LampIds]
}

StateObject

$index: {
  created_by: userId,
  //allowedUsers: [userId, ...],
  type: ENUM["COLOR"],
}
ColorObject
{
  ...,
  color: String // Hex color with 6 digits + `#` Symbol (e.g. `#ab98cd`)
}

About

SmartLight Client based on Google firebase

http://app.smartlight.hackedit.de

License:MIT License


Languages

Language:Vue 54.4%Language:JavaScript 38.3%Language:SCSS 3.8%Language:HTML 3.5%