Skip to content

Commit 578e222

Browse files
committed
Release 1.7.0
* update zigate lib to 0.40.4 * add thermostat support * add lock support
2 parents e04301a + 9f9dc9f commit 578e222

File tree

15 files changed

+237
-128
lines changed

15 files changed

+237
-128
lines changed

.buildpath

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Build & tests
2+
3+
on:
4+
[push, pull_request]
5+
6+
jobs:
7+
php:
8+
runs-on: ubuntu-latest
9+
name: Build and test PHP
10+
11+
strategy:
12+
matrix:
13+
php-version: [7.2, 7.3, 7.4]
14+
15+
steps:
16+
- name: Git checkout
17+
uses: actions/checkout@v2
18+
19+
- name: Setup PHP ${{ matrix.php-version }}
20+
uses: shivammathur/setup-php@master
21+
with:
22+
php-version: ${{ matrix.php-version }}
23+
24+
# - name: Validate composer.json and composer.lock
25+
# run: composer validate
26+
27+
- name: Install dependencies
28+
run: composer install --prefer-dist --no-progress --no-suggest --no-scripts
29+
30+
- name: Run test suite
31+
run: composer run-script test
32+
33+
- name: SonarCloud Scan
34+
if: matrix.php-version == '7.4'
35+
uses: sonarsource/sonarcloud-github-action@master
36+
with:
37+
# Disabling shallow clone is recommended for improving relevancy of reporting
38+
fetch-depth: 0
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
42+
43+
44+
python:
45+
runs-on: ubuntu-latest
46+
name: Build and test Python
47+
48+
strategy:
49+
matrix:
50+
python-version: [3.5, 3.6, 3.7, 3.8]
51+
max-parallel: 4
52+
53+
steps:
54+
- name: Git checkout
55+
uses: actions/checkout@v2
56+
57+
- name: Set up Python ${{ matrix.python-version }}
58+
uses: actions/setup-python@v1
59+
with:
60+
python-version: ${{ matrix.python-version }}
61+
62+
- name: Install Dependencies
63+
run: |
64+
python -m pip install --upgrade pip
65+
pip install flake8
66+
67+
- name: Lint with flake8
68+
run: |
69+
flake8 . --count --show-source --statistics
70+
71+
72+
markdownlint:
73+
runs-on: ubuntu-latest
74+
name: Test Markdown
75+
76+
steps:
77+
- name: Git checkout
78+
uses: actions/checkout@v2
79+
80+
- name: markdownlint-cli
81+
uses: nosborn/github-action-markdown-cli@v1.1.1
82+
with:
83+
files: "*.md docs/fr_FR/*.md"
84+
config_file: ".markdownlint.yaml"

.gitignore

Lines changed: 95 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,95 @@
1-
/vendor
2-
/.project
3-
/.pydevproject
1+
# Created by https://www.toptal.com/developers/gitignore/api/composer,pydev,eclipse,phpunit
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=composer,pydev,eclipse,phpunit
3+
4+
### Composer ###
5+
composer.phar
6+
/vendor/
7+
8+
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
9+
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
10+
# composer.lock
11+
12+
### Eclipse ###
13+
.metadata
14+
bin/
15+
tmp/
16+
*.tmp
17+
*.bak
18+
*.swp
19+
*~.nib
20+
local.properties
21+
.settings/
22+
.loadpath
23+
.recommenders
24+
25+
# External tool builders
26+
.externalToolBuilders/
27+
28+
# Locally stored "Eclipse launch configurations"
29+
*.launch
30+
31+
# PyDev specific (Python IDE for Eclipse)
32+
*.pydevproject
33+
34+
# CDT-specific (C/C++ Development Tooling)
35+
.cproject
36+
37+
# CDT- autotools
38+
.autotools
39+
40+
# Java annotation processor (APT)
41+
.factorypath
42+
43+
# PDT-specific (PHP Development Tools)
44+
.buildpath
45+
46+
# sbteclipse plugin
47+
.target
48+
49+
# Tern plugin
50+
.tern-project
51+
52+
# TeXlipse plugin
53+
.texlipse
54+
55+
# STS (Spring Tool Suite)
56+
.springBeans
57+
58+
# Code Recommenders
59+
.recommenders/
60+
61+
# Annotation Processing
62+
.apt_generated/
63+
.apt_generated_test/
64+
65+
# Scala IDE specific (Scala & Java development for Eclipse)
66+
.cache-main
67+
.scala_dependencies
68+
.worksheet
69+
70+
# Uncomment this line if you wish to ignore the project description file.
71+
# Typically, this file would be tracked if it contains build/dependency configurations:
72+
.project
73+
74+
### Eclipse Patch ###
75+
# Spring Boot Tooling
76+
.sts4-cache/
77+
78+
### PHPUnit ###
79+
# Covers PHPUnit
80+
# Reference: https://phpunit.de/
81+
82+
# Generated files
83+
.phpunit.result.cache
84+
85+
# PHPUnit
86+
/app/phpunit.xml
87+
/phpunit.xml
88+
89+
# Build data
90+
/build/
91+
92+
### pydev ###
93+
.pydevproject
94+
95+
# End of https://www.toptal.com/developers/gitignore/api/composer,pydev,eclipse,phpunit

.guardrails/config.ym

Lines changed: 0 additions & 4 deletions
This file was deleted.

.guardrails/ignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.markdownlint.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"line-length": false,
3+
"MD014": false,
4+
"MD033": {
5+
"allowed_elements": [
6+
"br"
7+
]
8+
}
9+
}

.settings/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 98 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
[![Percentage of issues still open](http://isitmaintained.com/badge/open/jeedom-zigate/jeedom-plugin-zigate.svg)](http://isitmaintained.com/project/jeedom-zigate/jeedom-plugin-zigate "Percentage of issues still open")
77
[![Gitter chat](https://badges.gitter.im/jeedom-zigate.png)](https://gitter.im/jeedom-zigate)
88

9-
[![Build Status](https://travis-ci.org/jeedom-zigate/jeedom-plugin-zigate.svg?branch=master)](https://travis-ci.org/jeedom-zigate/jeedom-plugin-zigate)
10-
[![GuardRails badge](https://badges.production.guardrails.io/jeedom-zigate/jeedom-plugin-zigate.svg)](https://www.guardrails.io)
9+
[![Build & tests](https://github.com/jeedom-zigate/jeedom-plugin-zigate/workflows/Build%20&%20tests/badge.svg?branch=master)](https://github.com/jeedom-zigate/jeedom-plugin-zigate/actions)
1110
[![SonarCloud: Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=jeedom-zigate:jeedom-plugin-zigate&metric=alert_status)](https://sonarcloud.io/dashboard?id=jeedom-zigate%3Ajeedom-plugin-zigate)
1211
[![SonarCloud: Bugs](https://sonarcloud.io/api/project_badges/measure?project=jeedom-zigate:jeedom-plugin-zigate&metric=bugs)](https://sonarcloud.io/dashboard?id=jeedom-zigate%3Ajeedom-plugin-zigate)
1312
[![SonarCloud: Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=jeedom-zigate:jeedom-plugin-zigate&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=jeedom-zigate%3Ajeedom-plugin-zigate)
@@ -45,4 +44,3 @@ Si vous souhaitez apporter une contribution à ce projet, nous vous suggérons d
4544
- <https://github.com/firstcontributions/first-contributions/blob/master/github-desktop-tutorial.md>
4645

4746
Certains développeurs pourraient également être intéressés par des dons sous forme de matériel, tels que des modules ou des dispositifs Zigbee, et même si ces dons sont le plus souvent donnés sans aucune condition, cela pourrait dans de nombreux cas motiver les développeurs et indirectement améliorer le développement de ce projet.
48-

SECURITY.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
We release patches for security vulnerabilities. Which versions are eligible receiving such patches depend on the CVSS v3.0 Rating:
6+
7+
| Version | Supported |
8+
| ------- | ------------------ |
9+
| 1.6.x | :white_check_mark: |
10+
| 1.5.x | :x: |
11+
| 1.4.x | :white_check_mark: |
12+
| 1.3.x | :x: |
13+
| 1.2.x | :x: |
14+
| 1.1.x | :x: |
15+
| 1.0.x | :x: |
16+
17+
## Reporting a Vulnerability
18+
19+
Please report (suspected) security vulnerabilities in private. You will receive a response from us within 48 hours. If the issue is confirmed, we will release a patch as soon as possible depending on complexity but historically within a few days.

core/class/zigate.class.php

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,17 @@ public function createCommands($device)
345345
$key = $this->_create_action($endpoint_id, $action, 'stop', 'other', 2);
346346
array_push($created_commands, $key);
347347
break;
348+
case 'thermostat':
349+
$key = $this->_create_action($endpoint_id, 'Occupied_temperature_setpoint', 'Occupied temperature setpoint', 'slider', [6, 28]);
350+
array_push($created_commands, $key);
351+
352+
$key = $this->_create_action($endpoint_id, 'System_mode', 'off', 'other', 0);
353+
array_push($created_commands, $key);
354+
$key = $this->_create_action($endpoint_id, 'System_mode', 'cooling', 'other', 3);
355+
array_push($created_commands, $key);
356+
$key = $this->_create_action($endpoint_id, 'System_mode', 'heating', 'other', 4);
357+
array_push($created_commands, $key);
358+
break;
348359
case 'ias':
349360
$key = $this->_create_action($endpoint_id, 'ias_off', 'off', 'other', 0);
350361
array_push($created_commands, $key);
@@ -363,7 +374,14 @@ public function createCommands($device)
363374

364375
$key = $this->_create_action($endpoint_id, 'ias_squawk', 'Armed', 'other', 'armed');
365376
array_push($created_commands, $key);
366-
377+
378+
break;
379+
case 'lock':
380+
$key = $this->_create_action($endpoint_id, $action, 'lock', 'other', 0);
381+
array_push($created_commands, $key);
382+
383+
$key = $this->_create_action($endpoint_id, $action, 'unlock', 'other', 1);
384+
array_push($created_commands, $key);
367385
break;
368386
}
369387
}
@@ -1025,6 +1043,12 @@ public function execute($_options = [])
10251043
case 'ias_squawk':
10261044
zigate::CallZiGate('action_ias_squawk', [$addr, $endpoint, $value, true]);
10271045
break;
1046+
case 'Occupied_temperature_setpoint':
1047+
zigate::CallZiGate('action_thermostat_occupied_heating_setpoint', [$addr, $endpoint, $value]);
1048+
break;
1049+
case 'System_mode':
1050+
zigate::CallZiGate('action_thermostat_system_mode', [$addr, $endpoint, $value]);
1051+
break;
10281052
}
10291053
}
10301054
}

0 commit comments

Comments
 (0)