iobroker.zigbee 1.6.14 → 1.6.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -130,6 +130,11 @@ You can thank the authors by these links:
130
130
  -->
131
131
 
132
132
  ## Changelog
133
+
134
+ ### 1.6.15 (2022-02-08)
135
+ * (arteck) Battery status % calculation was changed for xiaomi devices
136
+ *
137
+
133
138
  ### 1.6.14 (2022-01)
134
139
  * (asgothian) OTA limitation
135
140
  - devices with the available state set to false are excluded from OTA updates (and the update check)
package/io-package.json CHANGED
@@ -1,8 +1,13 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "zigbee",
4
- "version": "1.6.14",
4
+ "version": "1.6.15",
5
5
  "news": {
6
+ "1.6.15": {
7
+ "de": "Batterie Status wurde geändert",
8
+ "en": "Battery status was changed",
9
+ "ru": "Состояние батареи было изменено"
10
+ },
6
11
  "1.6.14": {
7
12
  "de": "Gruppen wurden überarbeitet 2",
8
13
  "en": "Groups were newly revised 2",
@@ -225,7 +230,15 @@
225
230
  "sentry": {
226
231
  "dsn": "https://c829e2ad996d45d1bdb2247805699883@o831057.ingest.sentry.io/5812498"
227
232
  }
228
- }
233
+ },
234
+ "dependencies": [
235
+ {
236
+ "admin": ">=3.0.0"
237
+ },
238
+ {
239
+ "js-controller": ">=1.4.2"
240
+ }
241
+ ]
229
242
  },
230
243
  "native": {
231
244
  "port": "",
package/lib/devices.js CHANGED
@@ -984,7 +984,7 @@ const devices = [
984
984
  syncStates: [sync.brightness],
985
985
  },
986
986
  {
987
- models: ['AC0251100NJ/AC0251700NJ'],
987
+ models: ['AC0251100NJ/AC0251600NJ/AC0251700NJ'],
988
988
  icon: 'img/lightify-switch.png',
989
989
  states: [states.switch_state, states.switch_circle, states.switch_hold, states.switch_release, states.battery],
990
990
  },
package/lib/exposes.js CHANGED
@@ -772,16 +772,20 @@ function applyExposes(mappedDevices, byModel, allExcludesObj) {
772
772
  const strippedModel = (deviceDef.model) ? deviceDef.model.replace(/\0.*$/g, '').trim() : '';
773
773
  // check if device is mapped
774
774
  const existsMap = byModel.get(strippedModel);
775
-
775
+
776
776
  if ((deviceDef.hasOwnProperty('exposes') && (!existsMap || !existsMap.hasOwnProperty('states'))) || allExcludesStr.indexOf(strippedModel) > 0) {
777
- const newDevice = createFromExposes(strippedModel, deviceDef);
778
- if (!existsMap) {
779
- mappedDevices.push(newDevice);
780
- byModel.set(strippedModel, newDevice);
781
- } else {
782
- existsMap.states = newDevice.states;
783
- existsMap.exposed = true;
784
- }
777
+ try {
778
+ const newDevice = createFromExposes(strippedModel, deviceDef);
779
+ if (!existsMap) {
780
+ mappedDevices.push(newDevice);
781
+ byModel.set(strippedModel, newDevice);
782
+ } else {
783
+ existsMap.states = newDevice.states;
784
+ existsMap.exposed = true;
785
+ }
786
+ } catch (e) {
787
+ console.log(`Wrong expose devicedefinition ${deviceDef.vendor} ${deviceDef.model}` );
788
+ }
785
789
  }
786
790
  }
787
791
  }
@@ -18,10 +18,18 @@ class StatesController extends EventEmitter {
18
18
  this.debugDevices = undefined;
19
19
  let fn = adapter.expandFileName('dev_names.json');
20
20
  this.dev_names_fn = fn.replace('.', '_');
21
+ this.retTimeoutHandle = null;
21
22
  fs.readFile(this.dev_names_fn, (err, data) => {
22
- if (!err) {
23
- savedDeviceNames = JSON.parse(data);
24
- }
23
+ if (!err) {
24
+ try
25
+ {
26
+ savedDeviceNames = JSON.parse(data);
27
+ }
28
+ catch
29
+ {
30
+ savedDeviceNames = {};
31
+ };
32
+ }
25
33
  });
26
34
  }
27
35
 
@@ -47,12 +55,14 @@ class StatesController extends EventEmitter {
47
55
 
48
56
  retainDeviceNames()
49
57
  {
50
- fs.writeFile(this.dev_names_fn, JSON.stringify(savedDeviceNames, null, 2), (err) => {
51
- if (err)
52
- this.error('error saving device names: ' + JSON.Stringify(err));
53
- else
54
- this.debug('saved device names');
55
- });
58
+ clearTimeout(this.retTimeoutHandle);
59
+ this.retTimeoutHanlde = setTimeout(()=> {
60
+ fs.writeFile(this.dev_names_fn, JSON.stringify(savedDeviceNames, null, 2), (err) => {
61
+ if (err)
62
+ this.error('error saving device names: ' + JSON.Stringify(err));
63
+ else
64
+ this.debug('saved device names');
65
+ });},5000);
56
66
  }
57
67
 
58
68
  getDebugDevices() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.zigbee",
3
- "version": "1.6.14",
3
+ "version": "1.6.15",
4
4
  "author": {
5
5
  "name": "Kirov Ilya",
6
6
  "email": "kirovilya@gmail.com"
@@ -18,24 +18,27 @@
18
18
  "node": ">=10"
19
19
  },
20
20
  "dependencies": {
21
- "zigbee-herdsman": "0.14.6",
22
- "zigbee-herdsman-converters": "14.0.397",
21
+ "zigbee-herdsman": "0.14.14",
22
+ "zigbee-herdsman-converters": "14.0.421",
23
23
  "@iobroker/adapter-core": "^2.4.0",
24
24
  "tar": "^6.0.5",
25
25
  "typescript": "^4.0.5"
26
26
  },
27
27
  "description": "Zigbee devices",
28
28
  "devDependencies": {
29
- "@alcalzone/release-script": "^2.2.0",
30
- "@iobroker/testing": "^2.5.1",
29
+ "@alcalzone/release-script": "~3.4.2",
30
+ "@iobroker/testing": "^2.5.4",
31
31
  "axios": "^0.21.1",
32
32
  "mixin-deep": "^1.3.2",
33
- "chai": "^4.2.0",
34
33
  "eslint": "^7.18.0",
35
34
  "eslint-config-google": "*",
36
- "gulp": "^4.0.0",
37
35
  "lint-diff": "*",
38
- "mocha": "^6.0.2"
36
+ "chai": "^4.3.4",
37
+ "chai-as-promised": "^7.1.1",
38
+ "gulp": "^4.0.2",
39
+ "gulp-jsdoc3": "^3.0.0",
40
+ "gulp-replace": "^1.1.3",
41
+ "mocha": "^9.1.3"
39
42
  },
40
43
  "homepage": "https://github.com/ioBroker/ioBroker.zigbee",
41
44
  "keywords": [
@@ -1,36 +0,0 @@
1
- // For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
2
- // https://github.com/microsoft/vscode-dev-containers/tree/v0.101.1/containers/docker-existing-docker-compose
3
- // If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml.
4
- {
5
- "name": "ioBroker Docker Compose",
6
-
7
- // Update the 'dockerComposeFile' list if you have more compose files or use different names.
8
- // The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
9
- "dockerComposeFile": ["docker-compose.yml"],
10
-
11
- // The 'service' property is the name of the service for the container that VS Code should
12
- // use. Update this value and .devcontainer/docker-compose.yml to the real service name.
13
- "service": "iobroker",
14
-
15
- // The optional 'workspaceFolder' property is the path VS Code should open by default when
16
- // connected. This is typically a file mount in .devcontainer/docker-compose.yml
17
- "workspaceFolder": "/workspace",
18
-
19
- // Set *default* container specific settings.json values on container create.
20
- "settings": {},
21
-
22
- // Add the IDs of extensions you want installed when the container is created.
23
- "extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"],
24
-
25
- // Uncomment the next line if you want start specific services in your Docker Compose config.
26
- // "runServices": [],
27
-
28
- // Uncomment the next line if you want to keep your containers running after VS Code shuts down.
29
- // "shutdownAction": "none",
30
-
31
- // When creating the container, delete unnecessary adapters, disable error reporting, set the license as confirmed, and install/update this adapter
32
- "postCreateCommand": "iob del discovery && iob plugin disable sentry && iob object set system.config common.licenseConfirmed=true && NPM_PACK=$(npm pack) && iob url \"$(pwd)/$NPM_PACK\" --debug && rm \"$NPM_PACK\""
33
-
34
- // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
35
- //"remoteUser": "iobroker"
36
- }
@@ -1,51 +0,0 @@
1
- version: '3'
2
-
3
- services:
4
- iobroker:
5
- build: ./iobroker
6
- container_name: iobroker-zigbee-d
7
- hostname: iobroker-zigbee-d
8
- # This port is only internal, so we can work on this while another instance of ioBroker is running on the host
9
- expose:
10
- - 8081
11
- volumes:
12
- - ..:/workspace
13
- - iobrokerdata-zigbee-d:/opt/iobroker
14
- environment:
15
- - LANG=en_US.UTF-8
16
- - LANGUAGE=en_US:en
17
- - LC_ALL=en_US.UTF-8
18
- - TZ=Europe/Berlin
19
- - SETGID=1000
20
-
21
- parcel:
22
- container_name: parcel-i2c
23
- build: ./parcel
24
- expose:
25
- - 1234
26
- ports:
27
- - '1235:1235'
28
- volumes:
29
- - ..:/workspace
30
- environment:
31
- - CHOKIDAR_USEPOLLING=1
32
-
33
- # Reverse proxy to load up-to-date admin sources from the repo
34
- nginx:
35
- image: nginx:latest
36
- depends_on:
37
- - iobroker
38
- - parcel
39
- links:
40
- - iobroker
41
- - parcel
42
- container_name: nginx-dvlp
43
- volumes:
44
- - ./nginx/nginx.conf:/etc/nginx/nginx.conf
45
- - ..:/workspace
46
- ports:
47
- # Make the ioBroker admin available under http://localhost:8082
48
- - 8082:80
49
-
50
- volumes:
51
- iobrokerdata-zigbee-d:
@@ -1,2 +0,0 @@
1
- FROM buanet/iobroker:latest
2
- RUN ln -s /opt/iobroker/node_modules/ /root/.node_modules
@@ -1,33 +0,0 @@
1
-
2
- worker_processes 1;
3
- events { worker_connections 1024; }
4
-
5
- http {
6
- sendfile on;
7
- keepalive_timeout 65;
8
-
9
- server {
10
- listen 80;
11
-
12
- location / {
13
- proxy_redirect off;
14
- proxy_pass http://iobroker:8081;
15
- }
16
-
17
- location /socket.io/ {
18
- proxy_pass http://iobroker:8081;
19
- proxy_http_version 1.1;
20
- proxy_set_header Upgrade $http_upgrade;
21
- proxy_set_header Connection "Upgrade";
22
- }
23
-
24
- location /adapter/i2c/ {
25
- alias /workspace/admin/;
26
- }
27
-
28
- location /adapter/i2c/build/ {
29
- proxy_redirect off;
30
- proxy_pass http://parcel:1234/;
31
- }
32
- }
33
- }
@@ -1,9 +0,0 @@
1
- FROM node:12
2
-
3
- RUN mkdir -p /usr/app
4
-
5
- COPY *.sh /usr/app/
6
-
7
- RUN chmod +x /usr/app/*.sh
8
-
9
- CMD /bin/bash -c "/usr/app/run.sh"
@@ -1,7 +0,0 @@
1
- #!/bin/bash
2
- cd /workspace
3
-
4
- echo "Installing all dependencies..."
5
- npm install
6
-
7
- npm run watch:parcel