Skip to content

Commit

Permalink
### 1.5.0 (2020-05-20)
Browse files Browse the repository at this point in the history
* (bluefox) Changed requirements for password
* (bluefox) Do not try load the "sharp" if blood sugar not enabled
  • Loading branch information
GermanBluefox committed May 20, 2020
1 parent 8283370 commit b4a12b2
Show file tree
Hide file tree
Showing 33 changed files with 254 additions and 131 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ Following types are supported:
- `ifttt` - acting like IFTTT (actually not required, but for tests purposes)

## Changelog
### 1.5.0 (2020-05-20)
* (bluefox) Changed requirements for password
* (bluefox) Do not try load the "sharp" if blood sugar not enabled

### 1.4.18 (2020-05-11)
* (Apollon77) Make sure that invalid configured states or values without timestamp do not crash adapter (Sentry IOBROKER-IOT-8)
Expand Down
16 changes: 8 additions & 8 deletions admin/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"files": {
"main.css": "./static/css/main.d4bed9c6.chunk.css",
"main.js": "./static/js/main.c340c4c7.chunk.js",
"main.js.map": "./static/js/main.c340c4c7.chunk.js.map",
"main.js": "./static/js/main.19895ef6.chunk.js",
"main.js.map": "./static/js/main.19895ef6.chunk.js.map",
"runtime-main.js": "./static/js/runtime-main.28893cca.js",
"runtime-main.js.map": "./static/js/runtime-main.28893cca.js.map",
"static/css/2.b1b16afe.chunk.css": "./static/css/2.b1b16afe.chunk.css",
"static/js/2.626a410c.chunk.js": "./static/js/2.626a410c.chunk.js",
"static/js/2.626a410c.chunk.js.map": "./static/js/2.626a410c.chunk.js.map",
"static/js/2.26c7b1e3.chunk.js": "./static/js/2.26c7b1e3.chunk.js",
"static/js/2.26c7b1e3.chunk.js.map": "./static/js/2.26c7b1e3.chunk.js.map",
"index.html": "./index.html",
"precache-manifest.96f83d294bf21dcc4d54812ef69a948f.js": "./precache-manifest.96f83d294bf21dcc4d54812ef69a948f.js",
"precache-manifest.2011d73a7c02bbe02537372a453a4d61.js": "./precache-manifest.2011d73a7c02bbe02537372a453a4d61.js",
"service-worker.js": "./service-worker.js",
"static/css/2.b1b16afe.chunk.css.map": "./static/css/2.b1b16afe.chunk.css.map",
"static/css/main.d4bed9c6.chunk.css.map": "./static/css/main.d4bed9c6.chunk.css.map",
"static/js/2.626a410c.chunk.js.LICENSE.txt": "./static/js/2.626a410c.chunk.js.LICENSE.txt",
"static/js/2.26c7b1e3.chunk.js.LICENSE.txt": "./static/js/2.26c7b1e3.chunk.js.LICENSE.txt",
"static/media/copy-content.svg": "./static/media/copy-content.6fe0b363.svg"
},
"entrypoints": [
"static/js/runtime-main.28893cca.js",
"static/css/2.b1b16afe.chunk.css",
"static/js/2.626a410c.chunk.js",
"static/js/2.26c7b1e3.chunk.js",
"static/css/main.d4bed9c6.chunk.css",
"static/js/main.c340c4c7.chunk.js"
"static/js/main.19895ef6.chunk.js"
]
}
2 changes: 1 addition & 1 deletion admin/index_m.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="./manifest.json"/><script type="text/javascript" src="./vendor/socket.io.js"></script><title>React App</title><link href="./static/css/2.b1b16afe.chunk.css" rel="stylesheet"><link href="./static/css/main.d4bed9c6.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,i,l=t[0],a=t[1],f=t[2],c=0,s=[];c<l.length;c++)i=l[c],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&s.push(o[i][0]),o[i]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(p&&p(t);s.length;)s.shift()();return u.push.apply(u,f||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,l=1;l<r.length;l++){var a=r[l];0!==o[a]&&(n=!1)}n&&(u.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},o={1:0},u=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="./";var l=this["webpackJsonpiot-admin"]=this["webpackJsonpiot-admin"]||[],a=l.push.bind(l);l.push=t,l=l.slice();for(var f=0;f<l.length;f++)t(l[f]);var p=a;r()}([])</script><script src="./static/js/2.626a410c.chunk.js"></script><script src="./static/js/main.c340c4c7.chunk.js"></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="./manifest.json"/><script type="text/javascript" src="./../../lib/js/socket.io.js"></script><title>React App</title><link href="./static/css/2.b1b16afe.chunk.css" rel="stylesheet"><link href="./static/css/main.d4bed9c6.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,i,l=t[0],a=t[1],f=t[2],c=0,s=[];c<l.length;c++)i=l[c],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&s.push(o[i][0]),o[i]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(p&&p(t);s.length;)s.shift()();return u.push.apply(u,f||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,l=1;l<r.length;l++){var a=r[l];0!==o[a]&&(n=!1)}n&&(u.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},o={1:0},u=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="./";var l=this["webpackJsonpiot-admin"]=this["webpackJsonpiot-admin"]||[],a=l.push.bind(l);l.push=t,l=l.slice();for(var f=0;f<l.length;f++)t(l[f]);var p=a;r()}([])</script><script src="./static/js/2.26c7b1e3.chunk.js"></script><script src="./static/js/main.19895ef6.chunk.js"></script></body></html>
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "a8d4de4129764ca4a693b88317389226",
"revision": "7031abaff14e7833da95846616ecde44",
"url": "./index.html"
},
{
"revision": "e5a8df5db1f098b68c9b",
"revision": "b6611f58db5a142eb181",
"url": "./static/css/2.b1b16afe.chunk.css"
},
{
"revision": "2800a77398e333efef69",
"revision": "4decde2dcdfb0987089f",
"url": "./static/css/main.d4bed9c6.chunk.css"
},
{
"revision": "e5a8df5db1f098b68c9b",
"url": "./static/js/2.626a410c.chunk.js"
"revision": "b6611f58db5a142eb181",
"url": "./static/js/2.26c7b1e3.chunk.js"
},
{
"revision": "4d7ef388ded4c46d8f17e43a588896c3",
"url": "./static/js/2.626a410c.chunk.js.LICENSE.txt"
"url": "./static/js/2.26c7b1e3.chunk.js.LICENSE.txt"
},
{
"revision": "2800a77398e333efef69",
"url": "./static/js/main.c340c4c7.chunk.js"
"revision": "4decde2dcdfb0987089f",
"url": "./static/js/main.19895ef6.chunk.js"
},
{
"revision": "52690254395a433bc1e0",
Expand Down
2 changes: 1 addition & 1 deletion admin/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");

importScripts(
"./precache-manifest.96f83d294bf21dcc4d54812ef69a948f.js"
"./precache-manifest.2011d73a7c02bbe02537372a453a4d61.js"
);

self.addEventListener('message', (event) => {
Expand Down
3 changes: 3 additions & 0 deletions admin/static/js/2.26c7b1e3.chunk.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions admin/static/js/2.26c7b1e3.chunk.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions admin/static/js/2.626a410c.chunk.js

This file was deleted.

1 change: 0 additions & 1 deletion admin/static/js/2.626a410c.chunk.js.map

This file was deleted.

2 changes: 2 additions & 0 deletions admin/static/js/main.19895ef6.chunk.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions admin/static/js/main.19895ef6.chunk.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions admin/static/js/main.c340c4c7.chunk.js

This file was deleted.

1 change: 0 additions & 1 deletion admin/static/js/main.c340c4c7.chunk.js.map

This file was deleted.

137 changes: 105 additions & 32 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
*/
'use strict';

const gulp = require('gulp');
const fs = require('fs');
const pkg = require('./package.json');
const gulp = require('gulp');
const fs = require('fs');
const pkg = require('./package.json');
const iopackage = require('./io-package.json');
const version = (pkg && pkg.version) ? pkg.version : iopackage.common.version;
const fileName = 'words.js';
const EMPTY = '';
const version = (pkg && pkg.version) ? pkg.version : iopackage.common.version;
const fileName = 'words.js';
const EMPTY = '';
const translate = require('./lib/tools.js').translateText;
const del = require('del');
const del = require('del');
const cp = require('child_process');

const languages = {
en: {},
Expand Down Expand Up @@ -475,38 +476,110 @@ gulp.task('translate', async function () {

gulp.task('translateAndUpdateWordsJS', gulp.series('translate', 'adminLanguages2words', 'adminWords2languages'));

gulp.task('build', done => {
const { exec } = require('child_process');
const version = JSON.parse(fs.readFileSync(__dirname + '/package.json').toString('utf8')).version;
const data = JSON.parse(fs.readFileSync(__dirname + '/src/package.json').toString('utf8'));
data.version = version;
fs.writeFileSync(__dirname + '/src/package.json', JSON.stringify(data, null, 2));

if (!fs.existsSync(__dirname + '/src/node_modules')) {
const child = exec('npm install', {stdio: [process.stdin, process.stdout, process.stderr], cwd: __dirname + '/src'});
child.on('exit', (code, signal) => {
const child_ = exec('npm run build', {stdio: [process.stdin, process.stdout, process.stderr], cwd: __dirname + '/src'});
child_.on('exit', (code, signal) => done());
gulp.task('clean', () =>
del(['admin/*/**', 'admin/*', '!admin/actions.js', '!admin/alexalogo.png', '!admin/blockly.js', '!admin/iot.png']));

function npmInstall() {
return new Promise((resolve, reject) => {
// Install node modules
const cwd = __dirname.replace(/\\/g, '/') + '/src/';

const cmd = `npm install`;
console.log(`"${cmd} in ${cwd}`);

// System call used for update of js-controller itself,
// because during installation npm packet will be deleted too, but some files must be loaded even during the install process.
const exec = require('child_process').exec;
const child = exec(cmd, {cwd});

child.stderr.pipe(process.stderr);
child.stdout.pipe(process.stdout);

child.on('exit', (code /* , signal */) => {
// code 1 is strange error that cannot be explained. Everything is installed but error :(
if (code && code !== 1) {
reject('Cannot install: ' + code);
} else {
console.log(`"${cmd} in ${cwd} finished.`);
// command succeeded
resolve();
}
});
});
}

gulp.task('2-npm', () => {
if (fs.existsSync(__dirname + '/src/node_modules')) {
return Promise.resolve();
} else {
const child = exec('npm run build', {stdio: [process.stdin, process.stdout, process.stderr], cwd: __dirname + '/src'});
child.on('exit', (code, signal) => done());
return npmInstall();
}
});

gulp.task('clean', () =>
del(['admin/*/**', 'admin/*', '!admin/actions.js', '!admin/alexalogo.png', '!admin/blockly.js', '!admin/iot.png']));
gulp.task('2-npm-dep', gulp.series('clean', '2-npm'));

gulp.task('copy', () => {
return gulp.src(['src/build/*/**', 'src/build/*'])
.pipe(gulp.dest('admin/'));
});
function build() {
return new Promise((resolve, reject) => {
const options = {
stdio: 'pipe',
cwd: __dirname + '/src/'
};

const version = JSON.parse(fs.readFileSync(__dirname + '/package.json').toString('utf8')).version;
const data = JSON.parse(fs.readFileSync(__dirname + '/src/package.json').toString('utf8'));
data.version = version;
fs.writeFileSync(__dirname + '/src/package.json', JSON.stringify(data, null, 2));

gulp.task('renameIndex', done => {
console.log(options.cwd);

let script = __dirname + '/src/node_modules/react-scripts/scripts/build.js';
if (!fs.existsSync(script)) {
script = __dirname + '/node_modules/react-scripts/scripts/build.js';
}
if (!fs.existsSync(script)) {
console.error('Cannot find execution file: ' + script);
reject('Cannot find execution file: ' + script);
} else {
const child = cp.fork(script, [], options);
child.stdout.on('data', data => console.log(data.toString()));
child.stderr.on('data', data => console.log(data.toString()));
child.on('close', code => {
console.log(`child process exited with code ${code}`);
code ? reject('Exit code: ' + code) : resolve();
});
}
});
}

gulp.task('3-build', () => build());

gulp.task('3-build-dep', gulp.series('2-npm', '3-build'));

gulp.task('5-copy', () =>
gulp.src(['src/build/*/**', 'src/build/*'])
.pipe(gulp.dest('admin/')));

gulp.task('5-copy-dep', gulp.series('3-build-dep', '5-copy'));

gulp.task('6-patch', () => new Promise(resolve => {
if (fs.existsSync(__dirname + '/admin/index.html')) {
fs.renameSync(__dirname + '/admin/index.html', __dirname + '/admin/index_m.html');
let code = fs.readFileSync(__dirname + '/admin/index.html').toString('utf8');
code = code.replace(/<script>var script=document\.createElement\("script"\)[^<]+<\/script>/,
`<script type="text/javascript" src="./../../lib/js/socket.io.js"></script>`);

fs.unlinkSync(__dirname + '/admin/index.html');
fs.writeFileSync(__dirname + '/admin/index_m.html', code);
}
done();
});
if (fs.existsSync(__dirname + '/src/build/index.html')) {
let code = fs.readFileSync(__dirname + '/src/build/index.html').toString('utf8');
code = code.replace(/<script>var script=document\.createElement\("script"\)[^<]+<\/script>/,
`<script type="text/javascript" src="./../../lib/js/socket.io.js"></script>`);

fs.writeFileSync(__dirname + '/src/build/index.html', code);
}
resolve();
}));

gulp.task('6-patch-dep', gulp.series('5-copy-dep', '6-patch'));

gulp.task('default', gulp.series('clean', 'build', 'copy', 'renameIndex'));
gulp.task('default', gulp.series('6-patch-dep'));
14 changes: 13 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"common": {
"name": "iot",
"version": "1.4.18",
"version": "1.5.0",
"title": "IoT Assistants",
"titleLang": {
"en": "IoT cloud connection",
Expand All @@ -28,6 +28,18 @@
"zh-cn": "连接你的ioBroker服务器的ioBroker IoT云"
},
"news": {
"1.5.0": {
"en": "Changed requirements for password.\nDo not try load the \"sharp\" if blood sugar not enabled",
"de": "Geänderte Anforderungen für Passwort.\nVersuchen Sie nicht, das \"scharfe\" zu laden, wenn der Blutzucker nicht aktiviert ist",
"ru": "Изменены требования к паролю.\nНе пытайтесь загрузить «острый», если уровень сахара в крови не включен",
"pt": "Requisitos alterados para senha.\nNão tente carregar o \"afiado\" se o açúcar no sangue não estiver ativado",
"nl": "Gewijzigde vereisten voor wachtwoord.\nProbeer de \"scherpe\" niet te laden als de bloedsuikerspiegel niet is ingeschakeld",
"fr": "Exigences modifiées pour le mot de passe.\nN'essayez pas de charger le \"pointu\" si la glycémie n'est pas activée",
"it": "Requisiti modificati per la password.\nNon provare a caricare il \"sharp\" se lo zucchero nel sangue non è abilitato",
"es": "Se modificaron los requisitos para la contraseña.\nNo intente cargar el \"fuerte\" si el azúcar en la sangre no está habilitado",
"pl": "Zmieniono wymagania dotyczące hasła.\nNie próbuj ładować „ostre”, jeśli cukier we krwi nie jest włączony",
"zh-cn": "更改了密码要求。\n如果未启用血糖,请勿尝试加载“锐利”"
},
"1.4.18": {
"en": "Make sure that invalid configured states or values without timestamp do not crash adapter (Sentry IOBROKER-IOT-8)\nMake sure publishes after disconnect to not break adapter (Sentry IOBROKER-IOT-A)",
"de": "Stellen Sie sicher, dass ungültige konfigurierte Zustände oder Werte ohne Zeitstempel den Adapter nicht zum Absturz bringen (Sentry IOBROKER-IOT-8).\nStellen Sie sicher, dass nach dem Trennen veröffentlicht wird, um den Adapter nicht zu beschädigen (Sentry IOBROKER-IOT-A).",
Expand Down
22 changes: 14 additions & 8 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ function startAdapter(options) {
}
defaultHistory= obj.common.defaultHistory;

alexaSH2 && alexaSH2.setLanguage(lang);
alexaSH3 && alexaSH3.setLanguage(lang);
yandexAlisa && yandexAlisa.setLanguage(lang);
alexaCustom && alexaCustom.setLanguage(lang);
alexaSH2 && alexaSH2.setLanguage(lang);
alexaSH3 && alexaSH3.setLanguage(lang);
yandexAlisa && yandexAlisa.setLanguage(lang);
alexaCustom && alexaCustom.setLanguage(lang);
alexaCustomBlood && alexaCustomBlood.setLanguage(lang, defaultHistory);
googleHome && googleHome.setLanguage(lang);
googleHome && googleHome.setLanguage(lang);
}
},
stateChange: (id, state) => {
Expand Down Expand Up @@ -890,6 +890,9 @@ function main() {
alexaSH2 = new AlexaSH2(adapter);
alexaSH3 = new AlexaSH3(adapter);
alexaCustom = new AlexaCustom(adapter);

}
if (adapter.config.amazonAlexaBlood) {
alexaCustomBlood = new AlexaCustomBlood(adapter);
}
if (adapter.config.yandexAlisa) {
Expand All @@ -908,7 +911,6 @@ function main() {
}
});


adapter.config.allowedServices = (adapter.config.allowedServices || '').split(/[,\s]+/);
for (let s = 0; s < adapter.config.allowedServices.length; s++) {
adapter.config.allowedServices[s] = adapter.config.allowedServices[s].trim();
Expand All @@ -918,8 +920,12 @@ function main() {
adapter.config.cloudUrl = adapter.config.cloudUrl || 'a18wym7vjdl22g.iot.eu-west-1.amazonaws.com';

if (!adapter.config.login || !adapter.config.pass) {
adapter.log.error('No cloud credentials found. Please get one on https://iobroker.pro');
return;
return adapter.log.error('No cloud credentials found. Please get one on https://iobroker.pro');
}

// check password
if (adapter.config.pass.length < 8 || !adapter.config.pass.match(/[a-z]/) || !adapter.config.pass.match(/[A-Z]/) || !adapter.config.pass.match(/\d/)) {
return adapter.log.error('The password must be at least 8 characters long and have numbers, upper and lower case letters. Please change the password in the profile https://iobroker.pro/accountProfile.');
}

if (adapter.config.iftttKey) {
Expand Down
Loading

0 comments on commit b4a12b2

Please sign in to comment.