Rewrite statusled implementation.

- Read it now from app.config JSON file.
- Allow for inverted status leds (Sonoff et al)
- Clean up unit tests.
This commit is contained in:
Pim van Pelt
2018-01-24 13:33:13 +01:00
parent f0fa04dc26
commit 118eb14447
11 changed files with 56 additions and 43 deletions

View File

@ -9,7 +9,7 @@ default: $(TARGET)
all: default
OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c))
SRCS = frozen/frozen.c ../src/channel.c ../src/mqtt.c ../src/led.c
SRCS = frozen/frozen.c ../src/channel.c ../src/mqtt.c ../src/statusled.c
HEADERS = $(wildcard *.h)
%.o: %.c $(HEADERS)

View File

@ -1,6 +1,7 @@
{
"name": "3 Gang",
"status_led": 0,
"name": "3 Gang, inverted statusled",
"statusled": 9,
"statusled_invert": true,
"channels": [
{ "led": 2, "relay": 15, "button": 5 },
{ "led": 14, "relay": 4, "button": 3 },

View File

@ -1,6 +1,6 @@
{
"name": "3 Gang, No LEDs",
"status_led": -1,
"statusled": -1,
"channels": [
{ "led": -1, "relay": 15, "button": 5 },
{ "led": -1, "relay": 4, "button": 3 },