diff --git a/drv/sonoff_tasmota_http/init.include.sh b/drv/sonoff_tasmota_http/init.include.sh index 57ba16d..991dda6 100644 --- a/drv/sonoff_tasmota_http/init.include.sh +++ b/drv/sonoff_tasmota_http/init.include.sh @@ -1,7 +1,7 @@ # # 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 diff --git a/drv/sonoff_tasmota_http/rele.include.sh b/drv/sonoff_tasmota_http/rele.include.sh index 860d505..91c5719 100644 --- a/drv/sonoff_tasmota_http/rele.include.sh +++ b/drv/sonoff_tasmota_http/rele.include.sh @@ -3,8 +3,7 @@ # # $1 identificativo relè da inizializzare # -function drv_remote_rele_init { - +function drv_sonoff_tasmota_http_rele_init { 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") 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" if [[ "$result" != "\"OFF\"" ]]; then local error="Command error: $response"