Skip to content

Commit e37fc67

Browse files
authored
Support for PCA9685 as RGB/RGBW/W dimmer (#421)
1 parent 751b0b5 commit e37fc67

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+814
-80
lines changed

.travis.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,4 +454,25 @@ jobs:
454454
- sed -r -i 's/\/\/(SensorPH .+)/\1/' $SKETCH
455455
- sed -r -i 's/\/\/(#include <sensors\/SensorPH.h>)/\1/' $SKETCH
456456
- eval $OTA_CONFIGURATION
457+
- eval $COMPILE
458+
- name: "SensorPca9685W"
459+
script:
460+
- arduino --install-library "Adafruit PWM Servo Driver Library"
461+
- sed -r -i 's/\/\/(SensorPca9685W .+)/\1/' $SKETCH
462+
- sed -r -i 's/\/\/(#include <sensors\/SensorPca9685W.h>)/\1/' $SKETCH
463+
- eval $OTA_CONFIGURATION
464+
- eval $COMPILE
465+
- name: "SensorPca9685Rgb"
466+
script:
467+
- arduino --install-library "Adafruit PWM Servo Driver Library"
468+
- sed -r -i 's/\/\/(SensorPca9685Rgb .+)/\1/' $SKETCH
469+
- sed -r -i 's/\/\/(#include <sensors\/SensorPca9685Rgb.h>)/\1/' $SKETCH
470+
- eval $OTA_CONFIGURATION
471+
- eval $COMPILE
472+
- name: "SensorPca9685Rgbw"
473+
script:
474+
- arduino --install-library "Adafruit PWM Servo Driver Library"
475+
- sed -r -i 's/\/\/(SensorPca9685Rgbw .+)/\1/' $SKETCH
476+
- sed -r -i 's/\/\/(#include <sensors\/SensorPca9685Rgbw.h>)/\1/' $SKETCH
477+
- eval $OTA_CONFIGURATION
457478
- eval $COMPILE

README.md

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ SensorNeopixel | 1 | Control a Neopixel LED
144144
SensorSDS011 | 2 | SDS011 air quality sensor, return concentrations of 2.5 and 10 micrometer particles. | https://github.com/ricki-z/SDS011
145145
SensorFPM10A | 1 | FPM10A fingerprint sensor | https://github.com/adafruit/Adafruit-Fingerprint-Sensor-Library
146146
SensorPH | 1 | PH ( SKU SEN161 ) sensor, measure the analog value from the amplifier module | -
147+
SensorPca9685W | 1 | Generic dimmer sensor (S_DIMMER) used to drive a single channel pwm output of PCA9685 | https://github.com/adafruit/Adafruit-PWM-Servo-Driver-Library
148+
SensorPca9685Rgb | 1 | Generic RGB-dimmer sensor (S_RGB_LIGHT) used to drive RGB resp. 3-channel pwm output of PCA9685 | https://github.com/adafruit/Adafruit-PWM-Servo- Driver-Library
149+
SensorPca9685Rgbw | 1 | Generic RGBW-dimmer sensor (S_RGBW_LIGHT) used to drive RGBW resp. 4-channel pwm output of PCA9685| https://github.com/adafruit/Adafruit-PWM-Servo-Driver-Library
147150

148151
Those sensors requiring a pin to operate would take it as an argument in the constructor.
149152
NodeManager automatically creates all the child_ids, assigning an incremental counter. If you need to set your own child_id, pass it as the last argument to the constructor
@@ -268,7 +271,7 @@ You can interact with each class provided by NodeManager through a set of API fu
268271
void registerTimer(Timer* timer);
269272
#endif
270273
// return the next-available child id
271-
uint8_t getAvailableChildId(uint8_t child_id = 255);
274+
uint8_t getAvailableChildId(uint8_t child_id = 0);
272275
// list containing all the registered sensors
273276
List<Sensor*> sensors;
274277
// return the Child object of the given child_id
@@ -882,6 +885,60 @@ Each sensor class may expose additional methods.
882885
void setPH4Voltage(float value);
883886
~~~
884887
888+
* SensorPca9685W
889+
~~~c
890+
// [101] set the effect to use for a smooth transition, can be one of SensorDimmer::EASE_LINEAR (0), SensorDimmer::EASE_INSINE (1), SensorDimmer::EASE_OUTSINE (2), SensorDimmer::EASE_INOUTSINE (3) (default: EASE_LINEAR)
891+
void setEasing(int value);
892+
// [102] the duration of entire the transition in seconds (default: 1)
893+
void setDuration(int value);
894+
// [103] the duration of a single step of the transition in milliseconds (default: 100)
895+
void setStepDuration(int value);
896+
//get instance of PCA9685-board
897+
Adafruit_PWMServoDriver* getPWMServoDriver();
898+
//set instance of PCA9685-board, if using more than one pca9685-dimmer sensor on the same pca9685-board
899+
void setPWMServoDriver(Adafruit_PWMServoDriver* servoDriver);
900+
//set the RGB (red/green/blue) value as hex-string (e.g. 000000...black/off, ff0000...red, 00ff00...green, 0000ff...blue, ffa500...orange, ffffff...white)
901+
void setRgbVal(String hexstring);
902+
//get the current RGB (red/green/blue) value as hex-string
903+
String getRgbVal();
904+
~~~
905+
906+
* SensorPca9685Rgb
907+
~~~c
908+
// [101] set the effect to use for a smooth transition, can be one of SensorDimmer::EASE_LINEAR (0), SensorDimmer::EASE_INSINE (1), SensorDimmer::EASE_OUTSINE (2), SensorDimmer::EASE_INOUTSINE (3) (default: EASE_LINEAR)
909+
void setEasing(int value);
910+
// [102] the duration of entire the transition in seconds (default: 1)
911+
void setDuration(int value);
912+
// [103] the duration of a single step of the transition in milliseconds (default: 100)
913+
void setStepDuration(int value);
914+
//get instance of PCA9685-board
915+
Adafruit_PWMServoDriver* getPWMServoDriver();
916+
//set instance of PCA9685-board, if using more than one pca9685-dimmer sensor on the same pca9685-board
917+
void setPWMServoDriver(Adafruit_PWMServoDriver* servoDriver);
918+
//set the RGB (red/green/blue) value as hex-string (e.g. 000000...black/off, ff0000...red, 00ff00...green, 0000ff...blue, ffa500...orange, ffffff...white)
919+
void setRgbVal(String hexstring);
920+
//get the current RGB (red/green/blue) value as hex-string
921+
String getRgbVal();
922+
~~~
923+
924+
* SensorPca9685Rgbw
925+
~~~c
926+
// [101] set the effect to use for a smooth transition, can be one of SensorDimmer::EASE_LINEAR (0), SensorDimmer::EASE_INSINE (1), SensorDimmer::EASE_OUTSINE (2), SensorDimmer::EASE_INOUTSINE (3) (default: EASE_LINEAR)
927+
void setEasing(int value);
928+
// [102] the duration of entire the transition in seconds (default: 1)
929+
void setDuration(int value);
930+
// [103] the duration of a single step of the transition in milliseconds (default: 100)
931+
void setStepDuration(int value);
932+
//get instance of PCA9685-board
933+
Adafruit_PWMServoDriver* getPWMServoDriver();
934+
//set instance of PCA9685-board, if using more than one pca9685-dimmer sensor on the same pca9685-board
935+
void setPWMServoDriver(Adafruit_PWMServoDriver* servoDriver);
936+
//set the RGBW (red/green/blue/white) value as hex-string (see RGB-examples from PCA9685RGB and add "00".."ff" for the white-channel)
937+
void setRgbwVal(String hexstring);
938+
//get the current RGBW (red/green/blue/white) value as hex-string
939+
String getRgbwVal();
940+
~~~
941+
885942
### OTA Configuration
886943

887944
When `NODEMANAGER_OTA_CONFIGURATION` is set to ON the API presented above can be also called remotely through `SensorConfiguration`, which is automatically added to NodeManager. SensorConfiguration exposes by default child id 200 that can be used to interact with the service by sending `V_CUSTOM` type of messages and commands within the payload. For each `REQ` message, the node will respond with a `SET` message if successful.

examples/Template/Template.ino

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,15 @@ NodeManager. Just uncomment the settings you need and the sensors you want to ad
346346
//#include <sensors/SensorPH.h>
347347
//SensorPH ph(A0);
348348

349+
//#include <sensors/SensorPca9685W.h>
350+
//SensorPca9685W pca9685W;
351+
352+
//#include <sensors/SensorPca9685Rgb.h>
353+
//SensorPca9685Rgb pca9685Rgb;
354+
355+
//#include <sensors/SensorPca9685Rgbw.h>
356+
//SensorPca9685Rgbw pca9685Rgbw;
357+
349358
/***********************************
350359
* Main Sketch
351360
*/

keywords.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,8 @@ SensorThermistor KEYWORD1
210210
SensorTSL2561 KEYWORD1
211211
SensorTTP KEYWORD1
212212
SensorVL53L0X KEYWORD1
213-
SensorWaterMeter KEYWORD1
213+
SensorWaterMeter KEYWORD1
214+
SensorPH KEYWORD1
215+
SensorPca9685Rgb KEYWORD1
216+
SensorPca9685Rgbw KEYWORD1
217+
SensorPca9685W KEYWORD1

nodemanager/Node.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,14 @@ void NodeManager::loop() {
461461

462462
// return the next available child_id
463463
uint8_t NodeManager::getAvailableChildId(uint8_t child_id) {
464-
// Childs 0 and 255 not allowed
465-
if ( (child_id != 0) && (child_id != 255) ) return child_id;
464+
if (child_id != 0) {
465+
// requested a specific child_id, check if it is available
466+
Child* child = getChild(child_id);
467+
if (child == nullptr) return child_id;
468+
}
469+
// automatic child_id assignment or child already in use
466470
for (int i = 1; i < 255; i++) {
471+
// look for the first available child_id
467472
Child* child = getChild(i);
468473
if (child == nullptr) return i;
469474
}

nodemanager/Node.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class NodeManager {
7474
// register a timer
7575
void registerTimer(Timer* timer);
7676
// return the next-available child id
77-
uint8_t getAvailableChildId(uint8_t child_id = 255);
77+
uint8_t getAvailableChildId(uint8_t child_id = 0);
7878
// list containing all the registered sensors
7979
List<Sensor*> sensors;
8080
// return the Child object of the given child_id

sensors/Display.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Display: public Sensor {
2828
const char* _caption = "";
2929

3030
public:
31-
Display(uint8_t child_id = 255): Sensor(-1) {
31+
Display(uint8_t child_id = 0): Sensor(-1) {
3232
_name = "";
3333
// We don't need any sensors, but we need a child, otherwise the loop will never be executed
3434
children.allocateBlocks(1);

sensors/DisplayHD44780.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class DisplayHD44780: public Display {
3434
uint8_t _i2caddress = 0x38;
3535
int _column = 0;
3636
public:
37-
DisplayHD44780(uint8_t child_id = 255): Display(child_id) {
37+
DisplayHD44780(uint8_t child_id = 0): Display(child_id) {
3838
_name = "HD44780";
3939
children.get()->setDescription(_name);
4040
};

sensors/DisplaySSD1306.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class DisplaySSD1306: public Display {
3939
uint8_t _contrast = -1;
4040

4141
public:
42-
DisplaySSD1306(uint8_t child_id = 255): Display(child_id) {
42+
DisplaySSD1306(uint8_t child_id = 0): Display(child_id) {
4343
_name = "SSD1306";
4444
children.get()->setDescription(_name);
4545
};

sensors/SensorAM2320.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ class SensorAM2320: public Sensor {
3131
AM2320* _th;
3232

3333
public:
34-
SensorAM2320(uint8_t child_id = 255): Sensor(-1) {
34+
SensorAM2320(uint8_t child_id = 0): Sensor(-1) {
3535
_name = "AM2320";
3636
children.allocateBlocks(2);
3737
new Child(this,FLOAT,nodeManager.getAvailableChildId(child_id),S_TEMP,V_TEMP,_name);
38-
new Child(this,FLOAT,nodeManager.getAvailableChildId(child_id+1),S_HUM,V_HUM,_name);
38+
new Child(this,FLOAT,child_id > 0 ? nodeManager.getAvailableChildId(child_id+1) : nodeManager.getAvailableChildId(child_id),S_HUM,V_HUM,_name);
3939
};
4040

4141
// define what to do during setup

sensors/SensorAPDS9960.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class SensorAPDS9960: public Sensor {
3131
SparkFun_APDS9960* _apds;
3232

3333
public:
34-
SensorAPDS9960(int8_t pin, uint8_t child_id = 255): Sensor(pin) {
34+
SensorAPDS9960(int8_t pin, uint8_t child_id = 0): Sensor(pin) {
3535
_name = "APDS9960";
3636
children.allocateBlocks(1);
3737
new Child(this,STRING,nodeManager.getAvailableChildId(child_id),S_INFO,V_TEXT,_name);

sensors/SensorAnalogInput.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class SensorAnalogInput: public Sensor {
3232
int _range_max = 1024;
3333

3434
public:
35-
SensorAnalogInput(int8_t pin, uint8_t child_id = 255): Sensor(pin) {
35+
SensorAnalogInput(int8_t pin, uint8_t child_id = 0): Sensor(pin) {
3636
_name = "ANALOG_I";
3737
children.allocateBlocks(1);
3838
new Child(this,INT,nodeManager.getAvailableChildId(child_id),S_CUSTOM,V_CUSTOM,_name);

sensors/SensorBH1750.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class SensorBH1750: public Sensor {
3232
BH1750* _lightSensor;
3333

3434
public:
35-
SensorBH1750(uint8_t child_id = 255): Sensor(-1) {
35+
SensorBH1750(uint8_t child_id = 0): Sensor(-1) {
3636
_name = "BH1750";
3737
children.allocateBlocks(1);
3838
new Child(this,INT,nodeManager.getAvailableChildId(child_id),S_LIGHT_LEVEL,V_LEVEL,_name);

sensors/SensorBME280.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ class SensorBME280: public SensorBosch {
3535
Adafruit_BME280* _bm;
3636

3737
public:
38-
SensorBME280(uint8_t child_id = 255): SensorBosch(child_id) {
38+
SensorBME280(uint8_t child_id = 0): SensorBosch(child_id) {
3939
_name = "BME280";
4040
children.allocateBlocks(4);
4141
new Child(this,FLOAT,nodeManager.getAvailableChildId(child_id),S_TEMP,V_TEMP,_name);
42-
new Child(this,FLOAT,nodeManager.getAvailableChildId(child_id+1),S_HUM,V_HUM,_name);
43-
new Child(this,FLOAT,nodeManager.getAvailableChildId(child_id+2),S_BARO,V_PRESSURE,_name);
44-
new Child(this,STRING,nodeManager.getAvailableChildId(child_id+3),S_BARO,V_FORECAST,_name);
42+
new Child(this,FLOAT,child_id > 0 ? nodeManager.getAvailableChildId(child_id+1) : nodeManager.getAvailableChildId(child_id),S_HUM,V_HUM,_name);
43+
new Child(this,FLOAT,child_id > 0 ? nodeManager.getAvailableChildId(child_id+2) : nodeManager.getAvailableChildId(child_id),S_BARO,V_PRESSURE,_name);
44+
new Child(this,STRING,child_id > 0 ? nodeManager.getAvailableChildId(child_id+3) : nodeManager.getAvailableChildId(child_id),S_BARO,V_FORECAST,_name);
4545
};
4646

4747
// set custom sampling to the sensor

sensors/SensorBMP085.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ class SensorBMP085: public SensorBosch {
3333
Adafruit_BMP085* _bm;
3434

3535
public:
36-
SensorBMP085(uint8_t child_id = 255): SensorBosch(child_id) {
36+
SensorBMP085(uint8_t child_id = 0): SensorBosch(child_id) {
3737
_name = "BMP085";
3838
children.allocateBlocks(3);
3939
new Child(this,FLOAT,nodeManager.getAvailableChildId(child_id),S_TEMP,V_TEMP,_name);
40-
new Child(this,FLOAT,nodeManager.getAvailableChildId(child_id+1),S_BARO,V_PRESSURE,_name);
41-
new Child(this,STRING,nodeManager.getAvailableChildId(child_id+2),S_BARO,V_FORECAST,_name);
40+
new Child(this,FLOAT,child_id > 0 ? nodeManager.getAvailableChildId(child_id+1) : nodeManager.getAvailableChildId(child_id),S_BARO,V_PRESSURE,_name);
41+
new Child(this,STRING,child_id > 0 ? nodeManager.getAvailableChildId(child_id+2) : nodeManager.getAvailableChildId(child_id),S_BARO,V_FORECAST,_name);
4242
};
4343

4444
// define what to do during setup

sensors/SensorBMP180.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ SensorBMP180
2727

2828
class SensorBMP180: public SensorBMP085 {
2929
public:
30-
SensorBMP180(uint8_t child_id = 255): SensorBMP085(child_id) {
30+
SensorBMP180(uint8_t child_id = 0): SensorBMP085(child_id) {
3131
_name = "BMP180";
3232
children.get(1)->setDescription(_name);
3333
children.get(2)->setDescription(_name);

sensors/SensorBMP280.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ class SensorBMP280: public SensorBosch {
3434
Adafruit_BMP280* _bm;
3535

3636
public:
37-
SensorBMP280(uint8_t child_id = 255): SensorBosch(child_id) {
37+
SensorBMP280(uint8_t child_id = 0): SensorBosch(child_id) {
3838
_name = "BMP280";
3939
children.allocateBlocks(3);
4040
new Child(this,FLOAT,nodeManager.getAvailableChildId(child_id),S_TEMP,V_TEMP,_name);
41-
new Child(this,FLOAT,nodeManager.getAvailableChildId(child_id+1),S_BARO,V_PRESSURE,_name);
42-
new Child(this,STRING,nodeManager.getAvailableChildId(child_id+2),S_BARO,V_FORECAST,_name);
41+
new Child(this,FLOAT,child_id > 0 ? nodeManager.getAvailableChildId(child_id+1) : nodeManager.getAvailableChildId(child_id),S_BARO,V_PRESSURE,_name);
42+
new Child(this,STRING,child_id > 0 ? nodeManager.getAvailableChildId(child_id+2) : nodeManager.getAvailableChildId(child_id),S_BARO,V_FORECAST,_name);
4343

4444
};
4545

sensors/SensorBosch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SensorBosch: public Sensor {
3535
bool _first_round = true;
3636

3737
public:
38-
SensorBosch(uint8_t child_id = 255): Sensor(-1) {
38+
SensorBosch(uint8_t child_id = 0): Sensor(-1) {
3939
_name = "BOSCH";
4040
// initialize the forecast samples array
4141
_forecast_samples = new float[_forecast_samples_count];

sensors/SensorChirp.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ class SensorChirp: public Sensor {
3535
bool _chirp_lightreversed = true;
3636

3737
public:
38-
SensorChirp(uint8_t child_id = 255): Sensor(-1) {
38+
SensorChirp(uint8_t child_id = 0): Sensor(-1) {
3939
_name = "CHIRP";
4040
children.allocateBlocks(3);
4141
new Child(this,FLOAT,nodeManager.getAvailableChildId(child_id),S_HUM,V_HUM,_name);
42-
new Child(this,FLOAT,nodeManager.getAvailableChildId(child_id+1),S_TEMP,V_TEMP,_name);
43-
new Child(this,FLOAT,nodeManager.getAvailableChildId(child_id+2),S_LIGHT_LEVEL,V_LIGHT_LEVEL,_name);
42+
new Child(this,FLOAT,child_id > 0 ? nodeManager.getAvailableChildId(child_id+1) : nodeManager.getAvailableChildId(child_id),S_TEMP,V_TEMP,_name);
43+
new Child(this,FLOAT,child_id > 0 ? nodeManager.getAvailableChildId(child_id+2) : nodeManager.getAvailableChildId(child_id),S_LIGHT_LEVEL,V_LIGHT_LEVEL,_name);
4444
};
4545

4646
// [101] set the soil moisture offset (default: 0)

sensors/SensorDHT.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ class SensorDHT: public Sensor {
3333
float _offset = 0;
3434

3535
public:
36-
SensorDHT(int8_t pin, uint8_t child_id = 255): Sensor(pin) {
36+
SensorDHT(int8_t pin, uint8_t child_id = 0): Sensor(pin) {
3737
_name = "DHT";
3838
_dht_type = DHT::DHT11;
3939
children.allocateBlocks(2);
4040
new Child(this,FLOAT,nodeManager.getAvailableChildId(child_id),S_TEMP,V_TEMP,_name);
41-
new Child(this,FLOAT,nodeManager.getAvailableChildId(child_id+1),S_HUM,V_HUM,_name);
41+
new Child(this,FLOAT,child_id > 0 ? nodeManager.getAvailableChildId(child_id+1) : nodeManager.getAvailableChildId(child_id),S_HUM,V_HUM,_name);
4242
};
4343

4444
// define what to do during setup

sensors/SensorDHT11.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ SensorDHT11
2727

2828
class SensorDHT11: public SensorDHT {
2929
public:
30-
SensorDHT11(int8_t pin, uint8_t child_id = 255): SensorDHT(pin, child_id) {
30+
SensorDHT11(int8_t pin, uint8_t child_id = 0): SensorDHT(pin, child_id) {
3131
_name = "DHT11";
3232
_dht_type = DHT::DHT11;
3333
children.get(1)->setDescription(_name);

sensors/SensorDHT22.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ SensorDHT22
3232
*/
3333
class SensorDHT22: public SensorDHT {
3434
public:
35-
SensorDHT22(int8_t pin, uint8_t child_id = 255): SensorDHT(pin, child_id) {
35+
SensorDHT22(int8_t pin, uint8_t child_id = 0): SensorDHT(pin, child_id) {
3636
_name = "DHT22";
3737
_dht_type = DHT::DHT22;
3838
children.get(1)->setDescription(_name);

sensors/SensorDigitalInput.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SensorDigitalInput: public Sensor {
2727
bool _invert_value_to_report = false;
2828
int _initial_value = -1;
2929
public:
30-
SensorDigitalInput(int8_t pin, uint8_t child_id = 255): Sensor(pin) {
30+
SensorDigitalInput(int8_t pin, uint8_t child_id = 0): Sensor(pin) {
3131
_name = "DIGITAL_I";
3232
children.allocateBlocks(1);
3333
new Child(this,INT,nodeManager.getAvailableChildId(child_id),S_CUSTOM,V_CUSTOM,_name);

sensors/SensorDigitalOutput.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class SensorDigitalOutput: public Sensor {
3434
Timer* _safeguard_timer = new Timer();
3535

3636
public:
37-
SensorDigitalOutput(int8_t pin, uint8_t child_id = 255): Sensor(pin) {
37+
SensorDigitalOutput(int8_t pin, uint8_t child_id = 0): Sensor(pin) {
3838
_name = "DIGITAL_O";
3939
children.allocateBlocks(1);
4040
new Child(this,INT,nodeManager.getAvailableChildId(child_id),S_CUSTOM,V_CUSTOM,_name);

sensors/SensorDimmer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class SensorDimmer: public Sensor {
4141
int _reverse = false;
4242

4343
public:
44-
SensorDimmer(int8_t pin, uint8_t child_id = 255): Sensor(pin) {
44+
SensorDimmer(int8_t pin, uint8_t child_id = 0): Sensor(pin) {
4545
_name = "DIMMER";
4646
children.allocateBlocks(2);
4747
new Child(this,INT,nodeManager.getAvailableChildId(child_id),S_DIMMER,V_STATUS,_name);

sensors/SensorDoor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
class SensorDoor: public SensorInterrupt {
2929
public:
30-
SensorDoor(int8_t pin, uint8_t child_id = 255): SensorInterrupt(pin, child_id) {
30+
SensorDoor(int8_t pin, uint8_t child_id = 0): SensorInterrupt(pin, child_id) {
3131
_name = "DOOR";
3232
children.get()->setPresentation(S_DOOR);
3333
children.get()->setType(V_TRIPPED);

sensors/SensorDs18b20.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class SensorDs18b20: public Sensor {
3232
DallasTemperature* _sensors;
3333

3434
public:
35-
SensorDs18b20(int8_t pin, uint8_t child_id = 255): Sensor(pin) {
35+
SensorDs18b20(int8_t pin, uint8_t child_id = 0): Sensor(pin) {
3636
_name = "DS18B20";
3737
// initialize the library
3838
OneWire* oneWire = new OneWire(_pin);

sensors/SensorFPM10A.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class SensorFPM10A: public Sensor {
3939
bool _fingerprint_is_valid = false;
4040

4141
public:
42-
SensorFPM10A(int8_t rxpin, int8_t txpin, uint8_t child_id = 255): Sensor(rxpin) {
42+
SensorFPM10A(int8_t rxpin, int8_t txpin, uint8_t child_id = 0): Sensor(rxpin) {
4343
_name = "FPM10A";
4444
_rx_pin = rxpin;
4545
_tx_pin = txpin;

0 commit comments

Comments
 (0)