Eseguito correzioni su driver sonoff_tasmota_http

This commit is contained in:
lejubila
2018-05-23 17:57:24 +02:00
parent 6f80b8ea21
commit c354f72c0c
2 changed files with 4 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
# #
# Questa funzione viene inviocata dalla funzione "init" di piGarden se sono presenti elettrovalvole o sensori che utilizzano questo driver # Questa funzione viene inviocata dalla funzione "init" di piGarden se sono presenti elettrovalvole o sensori che utilizzano questo driver
# #
function drv_sonoff_tasmota_http_rele_init { function drv_sonoff_tasmota_http_init {
local FOO=bar local FOO=bar

View File

@@ -3,8 +3,7 @@
# #
# $1 identificativo relè da inizializzare # $1 identificativo relè da inizializzare
# #
function drv_remote_rele_init { function drv_sonoff_tasmota_http_rele_init {
drv_remote_rele_open "$1" drv_remote_rele_open "$1"
} }
@@ -27,8 +26,9 @@ function drv_sonoff_tasmota_http_rele_open {
local response=$(drv_sonoff_tasmota_http_command "$remote" "$command") local response=$(drv_sonoff_tasmota_http_command "$remote" "$command")
echo "response=$response" echo "response=$response"
local jskey=${remote_alias^^}
local result=$(echo $response|$JQ -M ".$remote_alias") local result=$(echo $response|$JQ -M ".$jskey")
echo "result=$result" echo "result=$result"
if [[ "$result" != "\"OFF\"" ]]; then if [[ "$result" != "\"OFF\"" ]]; then
local error="Command error: $response" local error="Command error: $response"