Merge pull request #11 from karl0ss/PlugPics

Plug pics
This commit is contained in:
Karl Hudgell 2019-07-17 15:49:17 +01:00 committed by GitHub
commit ebb04d5c08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 18 additions and 2 deletions

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"docker.defaultRegistryPath": "karl0ss"
}

View File

@ -45,7 +45,7 @@ orvibo.startServer();
app.get('/', (req, res) => {
let sockets = orvibo.getConnectedSocket();
// let sockets = [{name: "Plug1", state: 1, uid: "222222"},{name: "Plug2", state: 0, uid: "111111"}]
// let sockets = [{name: "Plug1", state: 1, uid: "222222", modelId: "f8b11bed724647e98bd07a66dca6d5b6"},{name: "Plug2", state: 0, uid: "111111", modelId: "f8b11bed724647e98bd07a66dca6d5b6"}]
if (req.query.uid != undefined) {
orvibo.toggleSocket(req.query.uid);

View File

@ -1,6 +1,6 @@
{
"name": "orvibo-b25-server-kex",
"version": "1.0.2",
"version": "1.0.3",
"description": "A server to control the Orvibo B25 range of smart sockets",
"main": "index.js",
"scripts": {

View File

@ -36,6 +36,12 @@ body {
margin-bottom: 5px;
}
.socket-image {
width: 100%;
height: 300px;
}
.button-off {
background-color:#fc0000;
-moz-border-radius:28px;

BIN
server/images/b25.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
server/images/b25UK.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -8,6 +8,13 @@ block content
else
each socket in sockets
div.socket
case socket.modelId
when 'f8b11bed724647e98bd07a66dca6d5b6'
div.socket-image(style=`background: url('/images/b25UK.jpg') top center
no-repeat; background-size: cover;`)
//- when '123'
//- div.socket-image(style=`background: url('/images/b25.jpg') top center
//- no-repeat; background-size: cover;`)
h2.socket-name
| #{socket.name}
h2.socket-name