V_Light Deprecated
Change V_Light for V_Status as V_Light is deprecated as per is ttps://www.mysensors.org/download/serial_api_20 Change S_Light for S_Binary generic.
This commit is contained in:
@@ -65,7 +65,7 @@ void presentation()
|
|||||||
|
|
||||||
for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS;sensor++, pin++) {
|
for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS;sensor++, pin++) {
|
||||||
// Register all sensors to gw (they will be created as child devices)
|
// Register all sensors to gw (they will be created as child devices)
|
||||||
present(sensor, S_LIGHT);
|
present(sensor, S_BINARY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ void loop()
|
|||||||
|
|
||||||
void receive(const MyMessage &message) {
|
void receive(const MyMessage &message) {
|
||||||
// We only expect one type of message from controller. But we better check anyway.
|
// We only expect one type of message from controller. But we better check anyway.
|
||||||
if (message.type==V_LIGHT) {
|
if (message.type==V_STATUS) {
|
||||||
// Change relay state
|
// Change relay state
|
||||||
digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF);
|
digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF);
|
||||||
// Store state in eeprom
|
// Store state in eeprom
|
||||||
|
|||||||
Reference in New Issue
Block a user