You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if [ -f $RELAY_CTRL ]; then
case "cat $RELAY_CTRL" in
0) echo "$callback$LWRAPPER{"state":"off"}$RWRAPPER"
;;
1) echo "$callback$LWRAPPER{"state":"on"}$RWRAPPER"
;;
esac
fi
if [ -f $RELAY_CTRL2 ]; then
case "cat $RELAY_CTRL2" in
0) echo "$callback$LWRAPPER{"state":"off"}$RWRAPPER"
;;
1) echo "$callback$LWRAPPER{"state":"on"}$RWRAPPER"
;;
esac
fi
In version 2, we also have the option to light up the dimmer:
we should check if this is v1 or v2 and then set the correct path:
RELAY_CTRL=/sys/class/leds/tp-link:blue:relay/brightness
RELAY_CTRL2=/sys/class/leds/i-konke:red:relay/brightness
for example:
if [ -f $RELAY_CTRL ]; then
case "
cat $RELAY_CTRL
" in0) echo "$callback$LWRAPPER{"state":"off"}$RWRAPPER"
;;
1) echo "$callback$LWRAPPER{"state":"on"}$RWRAPPER"
;;
esac
fi
if [ -f $RELAY_CTRL2 ]; then
case "
cat $RELAY_CTRL2
" in0) echo "$callback$LWRAPPER{"state":"off"}$RWRAPPER"
;;
1) echo "$callback$LWRAPPER{"state":"on"}$RWRAPPER"
;;
esac
fi
In version 2, we also have the option to light up the dimmer:
DIM_CTRL=/sys/class/leds/i-konke:yellow:light/brightness
This stuff could be addded to the script to expand its range.
The text was updated successfully, but these errors were encountered: