Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Its only for the KK version 1 #12

Open
masterchop opened this issue Jan 16, 2016 · 1 comment
Open

Its only for the KK version 1 #12

masterchop opened this issue Jan 16, 2016 · 1 comment

Comments

@masterchop
Copy link

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" 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:

DIM_CTRL=/sys/class/leds/i-konke:yellow:light/brightness

This stuff could be addded to the script to expand its range.

@Japh
Copy link
Contributor

Japh commented Jan 17, 2016

Great suggestions, thanks! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants