This Repository contains the (Web-) UI for SmartLight as well as the Firebase hosted Backend Code.
# 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.
Variable | Description |
---|---|
VUE_APP_SENTRY_DSN |
SENTRY DSN URL - if defined, sentry is enabled and will report all errors |
All Objects that are defined here will be explained in detail below. This is just an overview.
{
users: {UserObject, ...},
units: {UnitObject ...},
states: {StateObject, ...},
}
$userId: {
apiSeret: String,
}
The apiSecret will be used for external API access like used for Google Home integration (via IFTTT).
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"]
}
}
{
...
ip: String,
hostname: String,
channelMap: Object,
}
lamptype
:RGB
,WWCW
,Switch
...channelMap
:{ r: 1, g: 2, b: 3}
with 1, 2 and 3 mixed up
{
...
lamps: [LampIds]
}
$index: {
created_by: userId,
//allowedUsers: [userId, ...],
type: ENUM["COLOR"],
}
{
...,
color: String // Hex color with 6 digits + `#` Symbol (e.g. `#ab98cd`)
}