Eseguito correzioni su driver sonoff_tasmota_http
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user