mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-21 22:48:16 +01:00
config change
This commit is contained in:
parent
dcc82d4bd8
commit
c984bc1adf
8 changed files with 613 additions and 369 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -6,3 +6,4 @@ dist
|
||||||
*.log
|
*.log
|
||||||
cbpi.egg-info
|
cbpi.egg-info
|
||||||
logs
|
logs
|
||||||
|
cbpi/extension/ui
|
|
@ -1,4 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
<component name="JavaScriptSettings">
|
||||||
|
<option name="languageLevel" value="JSX" />
|
||||||
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7.1 virtualenv at ~/cbp42" project-jdk-type="Python SDK" />
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7.1 virtualenv at ~/cbp42" project-jdk-type="Python SDK" />
|
||||||
</project>
|
</project>
|
File diff suppressed because it is too large
Load diff
|
@ -6,6 +6,7 @@ index_url: /api/doc
|
||||||
|
|
||||||
port: 8080
|
port: 8080
|
||||||
|
|
||||||
|
# login data
|
||||||
username: cbpi
|
username: cbpi
|
||||||
password: 123
|
password: 123
|
||||||
|
|
||||||
|
|
BIN
craftbeerpi.db
BIN
craftbeerpi.db
Binary file not shown.
|
@ -8,4 +8,4 @@ aiojobs==0.2.2
|
||||||
aiosqlite==0.7.0
|
aiosqlite==0.7.0
|
||||||
cryptography==2.3.1
|
cryptography==2.3.1
|
||||||
voluptuous==0.11.5
|
voluptuous==0.11.5
|
||||||
pyfigle==0.7.6
|
pyfiglet==0.7.6
|
51
samples.txt
Normal file
51
samples.txt
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
function noop() {}
|
||||||
|
|
||||||
|
export default function (url, opts) {
|
||||||
|
opts = opts || {};
|
||||||
|
|
||||||
|
var ws, num=0, $={};
|
||||||
|
var max = opts.maxAttempts || Infinity;
|
||||||
|
|
||||||
|
$.open = function () {
|
||||||
|
ws = new WebSocket(url, opts.protocols || []);
|
||||||
|
|
||||||
|
ws.onmessage = opts.onmessage || noop;
|
||||||
|
|
||||||
|
ws.onopen = function (e) {
|
||||||
|
(opts.onopen || noop)(e);
|
||||||
|
num = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
ws.onclose = function (e) {
|
||||||
|
e.code === 1e3 || e.code === 1005 || $.reconnect(e);
|
||||||
|
(opts.onclose || noop)(e);
|
||||||
|
};
|
||||||
|
|
||||||
|
ws.onerror = function (e) {
|
||||||
|
(e && e.code==='ECONNREFUSED') ? $.reconnect(e) : (opts.onerror || noop)(e);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
$.reconnect = function (e) {
|
||||||
|
(num++ < max) ? setTimeout(function () {
|
||||||
|
(opts.onreconnect || noop)(e);
|
||||||
|
$.open();
|
||||||
|
}, opts.timeout || 1e3) : (opts.onmaximum || noop)(e);
|
||||||
|
};
|
||||||
|
|
||||||
|
$.json = function (x) {
|
||||||
|
ws.send(JSON.stringify(x));
|
||||||
|
};
|
||||||
|
|
||||||
|
$.send = function (x) {
|
||||||
|
ws.send(x);
|
||||||
|
};
|
||||||
|
|
||||||
|
$.close = function (x, y) {
|
||||||
|
ws.close(x || 1e3, y);
|
||||||
|
};
|
||||||
|
|
||||||
|
$.open(); // init
|
||||||
|
|
||||||
|
return $;
|
||||||
|
}
|
2
setup.py
2
setup.py
|
@ -1,7 +1,7 @@
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
setup(name='cbpi',
|
setup(name='cbpi',
|
||||||
version='4.0.3',
|
version='4.0.4',
|
||||||
description='CraftBeerPi API',
|
description='CraftBeerPi API',
|
||||||
author='Manuel Fritsch',
|
author='Manuel Fritsch',
|
||||||
author_email='manuel@craftbeerpi.com',
|
author_email='manuel@craftbeerpi.com',
|
||||||
|
|
Loading…
Reference in a new issue