Disable zwave-js soft-reset on vm (#2261)

This commit is contained in:
Martin Hjelmare
2021-11-09 13:45:03 +01:00
committed by GitHub
parent b148a65c25
commit 4f3c3c06c4
4 changed files with 21 additions and 2 deletions

View File

@@ -1,5 +1,9 @@
# Changelog # Changelog
## 0.1.47
- Disable soft-reset if VM is detected
## 0.1.46 ## 0.1.46
- Bump Z-Wave JS to 8.7.5 - Bump Z-Wave JS to 8.7.5

View File

@@ -1,6 +1,6 @@
{ {
"name": "Z-Wave JS", "name": "Z-Wave JS",
"version": "0.1.46", "version": "0.1.47",
"slug": "zwave_js", "slug": "zwave_js",
"description": "Control a ZWave network with Home Assistant Z-Wave JS", "description": "Control a ZWave network with Home Assistant Z-Wave JS",
"arch": ["amd64", "i386", "armhf", "armv7", "aarch64"], "arch": ["amd64", "i386", "armhf", "armv7", "aarch64"],
@@ -8,6 +8,7 @@
"startup": "services", "startup": "services",
"init": false, "init": false,
"stage": "stable", "stage": "stable",
"hassio_api": true,
"homeassistant": "2021.2.0b0", "homeassistant": "2021.2.0b0",
"ports": { "ports": {
"3000/tcp": null "3000/tcp": null

View File

@@ -11,6 +11,8 @@ declare s2_authenticated
declare s2_unauthenticated declare s2_unauthenticated
declare log_level declare log_level
declare flush_to_disk declare flush_to_disk
declare host_chassis
declare soft_reset
readonly DOCS_EXAMPLE_KEY_1="2232666D100F795E5BB17F0A1BB7A146" readonly DOCS_EXAMPLE_KEY_1="2232666D100F795E5BB17F0A1BB7A146"
readonly DOCS_EXAMPLE_KEY_2="A97D2A51A6D4022998BEFC7B5DAE8EA1" readonly DOCS_EXAMPLE_KEY_2="A97D2A51A6D4022998BEFC7B5DAE8EA1"
@@ -98,6 +100,16 @@ else
log_level=$(bashio::config 'log_level') log_level=$(bashio::config 'log_level')
fi fi
host_chassis=$(bashio::host.chassis)
if [ "${host_chassis}" == "vm" ]; then
soft_reset=false
bashio::log.info "Virtual Machine detected, disabling soft-reset"
else
soft_reset=true
bashio::log.info "Virtual Machine not detected, enabling soft-reset"
fi
# Generate config # Generate config
bashio::var.json \ bashio::var.json \
@@ -106,6 +118,7 @@ bashio::var.json \
s2_authenticated "${s2_authenticated}" \ s2_authenticated "${s2_authenticated}" \
s2_unauthenticated "${s2_unauthenticated}" \ s2_unauthenticated "${s2_unauthenticated}" \
log_level "${log_level}" \ log_level "${log_level}" \
soft_reset "^${soft_reset}" \
| tempio \ | tempio \
-template /usr/share/tempio/zwave_config.conf \ -template /usr/share/tempio/zwave_config.conf \
-out /etc/zwave_config.json -out /etc/zwave_config.json

View File

@@ -13,5 +13,6 @@
"S2_AccessControl": "{{ .s2_access_control }}", "S2_AccessControl": "{{ .s2_access_control }}",
"S2_Authenticated": "{{ .s2_authenticated }}", "S2_Authenticated": "{{ .s2_authenticated }}",
"S2_Unauthenticated": "{{ .s2_unauthenticated }}" "S2_Unauthenticated": "{{ .s2_unauthenticated }}"
} },
"enableSoftReset": {{ .soft_reset }}
} }