Skip to content

Commit

Permalink
update to 1.3.0 (#143)
Browse files Browse the repository at this point in the history
* fix logic error in overwrite, fixes #116

* upgrade to 1.3

* update versions, changelog

* fix debounce config placement

* Update CHANGELOG.md
  • Loading branch information
danielwelch authored Apr 10, 2019
1 parent df7fcbe commit ead9782
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 19 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

This project is versioned based upon the version of [zigbee2mqtt](https://github.com/Koenkk/zigbee2mqtt). The versioning `X.Y.Z` of the stable release of this add-on will track that of zigbee2mqtt. If there are new releases without upgrades to the zigbee2mqtt version (i.e., changes to the add-on that occur between releases of zigbee2mqtt), an additional number will be added to indicate this (`X.Y.Z.A`, where `A` indicates a new versioned release).

## [1.3.0](https://github.com/danielwelch/hassio-zigbee2mqtt/releases/tag/v1.3.0) - 2019-04-08
### Changed
- Update zigbee2mqtt to version 1.3.0
### Added
- Includes new config option from zigbee2mqtt:
- `homeassistant_discovery_topic`
- `debounce` (device-specific config)
### Fixed
- Fixes logic bug that prevented configuration from being updated via the Hass.io frontend UI.

## [1.2.1](https://github.com/danielwelch/hassio-zigbee2mqtt/releases/tag/v1.2.1) - 2019-03-10
### Changed
- Update zigbee2mqtt to version 1.2.1
Expand Down
11 changes: 4 additions & 7 deletions zigbee2mqtt-edge/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@
"auto_uart": true,
"url": "https://github.com/danielwelch/hassio-zigbee2mqtt",
"startup": "before",
"arch": [
"aarch64",
"amd64",
"armhf",
"i386"
],
"arch": ["aarch64", "amd64", "armhf", "i386"],
"boot": "auto",
"map": ["share:rw"],
"options": {
Expand Down Expand Up @@ -51,6 +46,7 @@
"last_seen": "str?",
"elapsed": "bool?",
"overwrite": "bool?",
"homeassistant_discovery_topic": "str?",
"devices": [
{
"id": "str",
Expand All @@ -61,7 +57,8 @@
"occupancy_timeout": "int?",
"temperature_precision": "int?",
"humidity_precision": "int?",
"pressure_precision": "int?"
"pressure_precision": "int?",
"debounce": "float?"
}
],
"network_key": ["int?"]
Expand Down
2 changes: 1 addition & 1 deletion zigbee2mqtt/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM $BUILD_FROM
# Add env
ENV LANG C.UTF-8

ENV ZIGBEE2MQTT_VERSION=1.2.1
ENV ZIGBEE2MQTT_VERSION=1.3.0
ENV ARCHIVE=zigbee2mqtt-$ZIGBEE2MQTT_VERSION

COPY requirements.txt /requirements.txt
Expand Down
13 changes: 5 additions & 8 deletions zigbee2mqtt/config.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
{
"name": "zigbee2mqtt",
"version": "1.2.1",
"version": "1.3.0",
"slug": "zigbee2mqtt",
"description": "Zigbee to MQTT Bridge",
"auto_uart": true,
"url": "https://github.com/danielwelch/hassio-zigbee2mqtt",
"startup": "before",
"arch": [
"aarch64",
"amd64",
"armhf",
"i386"
],
"arch": ["aarch64", "amd64", "armhf", "i386"],
"boot": "auto",
"map": ["share:rw"],
"options": {
Expand Down Expand Up @@ -51,6 +46,7 @@
"last_seen": "str?",
"elapsed": "bool?",
"overwrite": "bool?",
"homeassistant_discovery_topic": "str?",
"devices": [
{
"id": "str",
Expand All @@ -60,7 +56,8 @@
"occupancy_timeout": "int?",
"temperature_precision": "int?",
"humidity_precision": "int?",
"pressure_precision": "int?"
"pressure_precision": "int?",
"debounce": "float?"
}
],
"network_key": ["int?"]
Expand Down
2 changes: 1 addition & 1 deletion zigbee2mqtt/set_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def __init__(self, config, options):

def set_option(self, option_name, category=None, alt_config_name=None):
# if overwrite is disabled (False), check if set and, if so, skip
if self.overwrite:
if not self.overwrite:
name = self._config_name(option_name, alt_config_name)
if self.get_config(name, category) is not None:
return
Expand Down
17 changes: 15 additions & 2 deletions zigbee2mqtt/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,28 @@ def test_config_disable_overwrite():
options_path = Path('./zigbee2mqtt/test_hassio_options.json')
with open(options_path) as f:
options = json.load(f)
# set_option should do nothing when overwrite set to True
options["overwrite"] = True
# set_option should do nothing when overwrite set to False
options["overwrite"] = False
options["mqtt_base_topic"] = "neversetme"
cfg = ConfigBuilder({"mqtt": {"base_topic": "zigbee2mqtt"}}, options)
cfg.set_option(
'mqtt_base_topic', category='mqtt', alt_config_name='base_topic')
assert cfg.get_config('base_topic', category="mqtt") == "zigbee2mqtt"


def test_config_enable_overwrite():
from set_config import ConfigBuilder
options_path = Path('./zigbee2mqtt/test_hassio_options.json')
with open(options_path) as f:
options = json.load(f)
options["overwrite"] = True
options["mqtt_base_topic"] = "replacewithme"
cfg = ConfigBuilder({"mqtt": {"base_topic": "zigbee2mqtt"}}, options)
cfg.set_option(
'mqtt_base_topic', category='mqtt', alt_config_name='base_topic')
assert cfg.get_config('base_topic', category="mqtt") == "replacewithme"


def test_config_set_devices_config():
from set_config import ConfigBuilder
config = {}
Expand Down

0 comments on commit ead9782

Please sign in to comment.