Update a lamp's state. This does the same as PATCH /lamps/:id/state
but is duplicated on the websocket server so the board can send this event with only one open connection.
Payload:
{
"lampId": "xxxxxxxxxxxxxxxxxxxxxxxx",
"color": "#ff00ff",
"touching": true
}
Sends the config file to the server. This is called after the server sends REQUEST_CONFIG
.
{
"deviceId": "xxxxxxxxxxxxxxxxxxxxxxxx",
"lampId": "xxxxxxxxxxxxxxxxxxxxxxxx",
"wifi": [
{
"ssid": "My network",
"password": "password"
}
],
"brightness": 0.9,
"nightMode": true,
"minimumLightLevel": 0.2,
"readingLightColorTemperature": 2700
}
All these events correspond to mutations in the Vuex store (💻) or are send to the board to perform an action (⚛️).
Removes the config file and reset the board to its default state.
Payload:
{}
Fired when a user in your group starts or stops touching their lamp. Returns a new group state with the computed colors and active flag.
Payload:
{
"groupId": "xxxxxxxxxxxxxxxxxxxxxxxx",
"state": {
"colors": ["#ff00ff", "#00ff00", "#0000fff"],
"active": true
}
Updates fields in the config file (config.json). Only the fields below are allowed to be updated.
Payload:
{
"brightness": 0.9,
"nightMode": true,
"minimumLightLevel": 0.2,
"readingLightColorTemperature": 2700
}
Requests the board to send it's config file (config.json).
Payload:
{}
Updates or adds a user to the store
Payload:
{
"_id": "xxxxxxxxxxxxxxxxxxxxxxxx",
"googleId": "xxxxxxxxxxxxxxxxxxxxx",
"name": "Alex Wohlbruck",
"familyName": "Wohlbruck",
"givenName": "Alex",
"email": "[email protected]",
"picture": "https://lh3.googleusercontent.com/a-/AOh14GhYgUCf9yFuj-Xt6_X_cDz-5gSusrGde-lerdKqXxA=s96-c",
"createdAt": "2022-03-08T01:50:46.226Z",
"updatedAt": "2022-03-08T01:50:46.226Z",
"__v": 0
}
Removes a user from the store
Payload:
{
"_id": "xxxxxxxxxxxxxxxxxxxxxxxx",
}
Updates or adds a lamp to the store
Payload:
{
"state": {
"color": "#ff0000",
"touching": false
},
"deviceData": {
"deviceId": "xxxxxxxxxxx"
},
"_id": "xxxxxxxxxxxxxxxxxxxxxxxx",
"name": "My lamp",
"createdAt": "2022-03-22T21:38:02.337Z",
"updatedAt": "2022-03-22T21:38:02.337Z",
"__v": 0,
"userId": "xxxxxxxxxxxxxxxxxxxxxxxx",
"groupId": "xxxxxxxxxxxxxxxxxxxxxxxx"
}
Removes a lamp from the store
Payload:
{
"_id": "xxxxxxxxxxxxxxxxxxxxxxxx",
}