Skip to content

Commit

Permalink
Formatting and package update
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Nov 28, 2022
1 parent 5806222 commit 0471442
Show file tree
Hide file tree
Showing 37 changed files with 1,673 additions and 14,898 deletions.
17 changes: 17 additions & 0 deletions .github/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Configure here which dependency updates should be merged automatically.
# The recommended configuration is the following:
- match:
# Only merge patches for production dependencies
dependency_type: production
update_type: "semver:patch"
- match:
# Except for security fixes, here we allow minor patches
dependency_type: production
update_type: "security:minor"
- match:
# and development dependencies can have a minor update, too
dependency_type: development
update_type: "semver:minor"

# The syntax is based on the legacy dependabot v1 automerged_updates syntax, see:
# https://dependabot.com/docs/config-file/#automerged_updates
24 changes: 24 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: monthly
time: "04:00"
timezone: Europe/Berlin
- package-ecosystem: npm
directory: "/"
schedule:
interval: monthly
time: "04:00"
timezone: Europe/Berlin
open-pull-requests-limit: 5
versioning-strategy: increase
- package-ecosystem: npm
directory: "/src"
schedule:
interval: monthly
time: "04:00"
timezone: Europe/Berlin
open-pull-requests-limit: 5
versioning-strategy: increase
41 changes: 41 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: "46 19 * * 0"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ javascript ]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
22 changes: 22 additions & 0 deletions .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Automatically merge Dependabot PRs when version comparison is within the range
# that is configured in .github/auto-merge.yml

name: Auto-Merge Dependabot PRs

on:
pull_request_target:

jobs:
auto-merge:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Check if PR should be auto-merged
uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
# This must be a personal access token with push access
github-token: ${{ secrets.AUTO_MERGE_TOKEN }}
# By default, squash and merge, so Github chooses nice commit messages
command: squash and merge
6 changes: 3 additions & 3 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm ci
run: npm i

- name: Lint source code
run: npm run lint
Expand All @@ -50,7 +50,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [14.x, 16.x, 18.x]
os: [ubuntu-latest, macos-latest]

steps:
Expand All @@ -63,7 +63,7 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm ci
run: npm i

- name: Run unit tests
run: npm run test:unit
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ admin/i18n/*/flat.txt
debugidentify.js
.devcontainer
docs
package-lock.json
12 changes: 0 additions & 12 deletions .npmignore

This file was deleted.

3 changes: 3 additions & 0 deletions .releaseconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["iobroker", "license"]
}
36 changes: 8 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@
[![Downloads](https://img.shields.io/npm/dm/iobroker.zigbee.svg)](https://www.npmjs.com/package/iobroker.zigbee)

## ioBroker adapter for Zigbee devices via TI cc2531/cc2530/cc26x2r/cc2538 and deCONZ ConBee/RaspBee.

With the Zigbee-coordinator based on Texas Instruments SoC, deCONZ ConBee/RaspBee modules, Silicon Labs EZSP v8 or ZIGate USB-TTL it creates its own zigbee-network, into which zigbee-devices are connected. By work directly with the coordinator, the driver allows you to manage devices without additional application / gateways / bridge from device manufacturers (Xiaomi / TRADFRI / Hue / Tuya). About the device Zigbee-network can be read [here (in English)](https://www.zigbee2mqtt.io/information/zigbee_network.html).
With the Zigbee-coordinator based on `Texas Instruments SoC, deCONZ ConBee/RaspBee` modules, `Silicon Labs EZSP v8` or `ZIGate USB-TTL` it creates its own zigbee-network, into which zigbee-devices are connected. By work directly with the coordinator, the driver allows you to manage devices without additional application / gateways / bridge from device manufacturers (Xiaomi / TRADFRI / Hue / Tuya). About the device Zigbee-network can be read [here (in English)](https://www.zigbee2mqtt.io/information/zigbee_network.html).

## Hardware


One coordinator device is required for each zigbee Adapter instance. The device must be flashed with the respective coordinator firmware. A list of supported coordinators, the necessary equipment for the firmware and the device preparation process for different coordinator devices are described [here (in English)](https://www.zigbee2mqtt.io/guide/adapters/) or [here (in Russian)](https://myzigbee.ru/books/%D0%BF%D1%80%D0%BE%D1%88%D0%B8%D0%B2%D0%BA%D0%B8/page/%D0%BF%D1%80%D0%BE%D1%88%D0%B8%D0%B2%D0%BA%D0%B0-cc2531cc2530)


### Texas Instruments SoC

Recommended devices are based on either the CC2652 or CC1352 chip. Devices based on cc253x chips are still supported but are no longer recommended.
Only CC26xx/cc1352/cc2538 Devices support extraction of the NVRam backup which should allow to swap coordinator hardware without having to reconnect all zigbee devices to the network.
Current firmware files for these devices can be found [on GitHub](https://github.com/Koenkk/Z-Stack-firmware)
Expand All @@ -32,9 +27,7 @@ Current firmware files for these devices can be found [on GitHub](https://github
<span><img src="docs/de/img/CC2538_CC2592_PA.PNG" width="100"></span>
<span><img src="docs/de/img/cc26x2r.PNG" width="100"></span>


### Dresden Elektronik SoC

<span><img src="docs/en/img/deconz.png"></span>

recommended:
Expand All @@ -45,31 +38,25 @@ no longer recommended:
- ConBee I
- RaspBee

While Conbee/RaspBee Support is no longer considered experimental in the zigbee-herdsman and zigbee-herdsman-converters libraries used by the zigbee Adapter, use of these devices with the adapter may limit functionality. Known issues are:
While `Conbee/RaspBee` Support is no longer considered experimental in the zigbee-herdsman and zigbee-herdsman-converters libraries used by the zigbee Adapter, use of these devices with the adapter may limit functionality. Known issues are:
- link quality display may be incorrect
- device map metrics may be incorrect
- NVRam Backup is not supported.

### Silicon Labs SoC

Support for [Silicon Lab Zigbee](https://www.silabs.com/wireless/zigbee) based adapters is experimental. The initial support for EZSP v8 is still not yet considered stable and the project is in need of more developers volenteering to help with this integration. Please refer to the respective documentation on [this page](https://www.zigbee2mqtt.io/guide/adapters/) and [ongoing development discussion](https://github.com/Koenkk/zigbee-herdsman/issues/319) with regards to the state of Silabs EmberZNet Serial Protocol (EZSP) adapter implementation integration into the zigbee-herdsman and zigbee-herdsman-converters libraries which it depends on.

Support for [Silicon Lab Zigbee](https://www.silabs.com/wireless/zigbee) based adapters is experimental. The initial support for EZSP v8 is still not yet considered stable and the project is in need of more developers volunteering to help with this integration. Please refer to the respective documentation on [this page](https://www.zigbee2mqtt.io/guide/adapters/) and [ongoing development discussion](https://github.com/Koenkk/zigbee-herdsman/issues/319) with regard to the state of Silabs EmberZNet Serial Protocol (EZSP) adapter implementation integration into the zigbee-herdsman and zigbee-herdsman-converters libraries which it depends on.

### ZiGate SoC

Support for [ZiGate](https://zigate.fr) based adapters is experimental. The initial support for ZiGate is still not yet considered stable and the project is in need of more developers volenteering to help with this integration. Please refer to the respective documentation on [this page](https://www.zigbee2mqtt.io/guide/adapters/) and [ongoing development discussion](https://github.com/Koenkk/zigbee-herdsman/issues/242) with regards to the state of ZiGate adapter implementation into the zigbee-herdsman and zigbee-herdsman-converters libraries which it depends on.

Support for [ZiGate](https://zigate.fr) based adapters is experimental. The initial support for ZiGate is still not yet considered stable and the project is in need of more developers volunteering to help with this integration. Please refer to the respective documentation on [this page](https://www.zigbee2mqtt.io/guide/adapters/) and [ongoing development discussion](https://github.com/Koenkk/zigbee-herdsman/issues/242) with regard to the state of ZiGate adapter implementation into the zigbee-herdsman and zigbee-herdsman-converters libraries which it depends on.

## Work with adapter

![](docs/tutorial/zigbee.png)

To start the driver, you must specify the name of the port on which the Zigbee-module (stick) is connected. Usually this is the port `/dev/ttyACM0` or `/dev/ttyUSB0` for the UART-connection. Or you can find with `ls -l /dev/serial/by-id` the device direct.

open the settings and change port
![](docs/tutorial/settings.png)


For Windows this will be the COM port number.

Starting from version 1.0.0 you can also use *tcp connection* for cases using esp8266 (or other microcontrollers) as serial-bridge. For example `tcp://192.168.1.46:8880`. Read more info here https://www.zigbee2mqtt.io/information/connecting_cc2530#via-an-esp8266
Expand All @@ -92,30 +79,24 @@ It is a Zigbee feature, intended for example to switch bulbs synchronized. Assig

Note: Not all devices support groups (not supported by end devices like sensors).


### Binding

https://www.zigbee2mqtt.io/information/binding

### Developer Tab

This is a tool for advanced users to test currently unsupported devices or enhance this adapters functionality. More instructions can be found on tab.
This is a tool for advanced users to test currently unsupported devices or enhance this adapter's functionality. More instructions can be found on tab.
![](docs/tutorial/tab-dev-1.png)

## Additional info

There is a [friendly project](https://github.com/koenkk/zigbee2mqtt) with similar functionality on the same technologies, where you can work with the same devices using the MQTT protocol. Therefore, if any improvements or support for new zigbee-devices occur in the Zigbee2MQTT project, we can transfer and add the same functionality to this adapter. If you notice this, then write the issue - we'll postpone it.

There are knowledge bases that can be useful for working with Zigbee-devices and equipment:
* in English https://www.zigbee2mqtt.io/
* in Russian https://myzigbee.ru/

## Supported devices

Works with devices from this list https://github.com/ioBroker/ioBroker.zigbee/wiki/Supported-devices

## Donate

You can thank the authors by these links:
* to Kirov Ilya https://www.paypal.me/goofyk
* to Arthur Rupp https://paypal.me/ArthurRupp
Expand All @@ -131,7 +112,6 @@ You can thank the authors by these links:
### **WORK IN PROGRESS**
-->


## Changelog
### 1.7.7 (2022-11-24)
* dep update
Expand Down Expand Up @@ -179,8 +159,8 @@ You can thank the authors by these links:
- when a pingable device is marked active (from being inactive) it will be pinged again.
- inactive devices are excluded from OTA updates.
* (asgothian) Group rework part 2:
- state device.groups will now be deleted with state Cleanup
- state info.groups is now obsolete and will be deleted at adapter start (after transferring data to
- state `device.groups` will now be deleted with state Cleanup
- state `info.groups` is now obsolete and will be deleted at adapter start (after transferring data to
the new storage)
* (asgothian) Device name persistance.
- Changes to device names made within the zigbee adapter are stored in the file dev_names.json. This file
Expand All @@ -194,7 +174,7 @@ You can thank the authors by these links:

### 1.6.12 (2022-01)
* (asgothian) Groups were newly revised (read [here](https://github.com/ioBroker/ioBroker.zigbee/pull/1327) )
- object device.groups is obsolet..the old one is no longer up to date
- object `device.groups` is obsolet. The old one is no longer up to date

### 1.6.9 (2021-12)
* (simatec) fix admin Dark-Mode
Expand Down
8 changes: 5 additions & 3 deletions admin/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1389,12 +1389,14 @@ function getComPorts(onChange) {
// }, 1000);
// return;
// }
if (!list) return;
if (!list) {
return;
}
const element = $('#ports');
for (let j = 0; j < list.length; j++) {
element.append('<li><a href="#!">' + list[j].comName +'</a></li>');
element.append('<li><a href="#!">' + list[j].comName + (list[j].name ? (' [' + list[j].name + ']') : '') + '</a></li>');
}
$('#ports a').click(function() {
$('#ports a').click(function () {
$('#port').val($(this).text());
Materialize.updateTextFields();
onChange();
Expand Down
24 changes: 0 additions & 24 deletions appveyor.yml

This file was deleted.

4 changes: 2 additions & 2 deletions lib/backup.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Backup {
}
}

async configure (zigbeeOptions) {
async configure(zigbeeOptions) {
this.zigbeeOptions = zigbeeOptions;
this.backup(zigbeeOptions);
const allBackupFiles = this.listBackupsFiles(zigbeeOptions);
Expand Down Expand Up @@ -121,7 +121,7 @@ class Backup {
delBackupsFiles(options, files) {
const arr = files.length;
if (arr > 10) {
this.info('delete old Backup files. keep only last 10')
this.info('delete old Backup files. keep only last 10');
}

for (let i = 10; i < files.length; i++) {
Expand Down
Loading

0 comments on commit 0471442

Please sign in to comment.