mirror of
https://github.com/anklimov/lighthub
synced 2025-12-08 12:49:50 +03:00
negative pin init hung fixed, homie nodes list submittind removed (unstable if long list)
This commit is contained in:
@@ -409,8 +409,8 @@ void onMQTTConnect(){
|
|||||||
aJsonObject * item = items->child;
|
aJsonObject * item = items->child;
|
||||||
while (items && item)
|
while (items && item)
|
||||||
if (item->type == aJson_Array && aJson.getArraySize(item)>0) {
|
if (item->type == aJson_Array && aJson.getArraySize(item)>0) {
|
||||||
strncat(buf,item->name,sizeof(buf));
|
/// strncat(buf,item->name,sizeof(buf));
|
||||||
strncat(buf,",",sizeof(buf));
|
/// strncat(buf,",",sizeof(buf));
|
||||||
|
|
||||||
switch ( aJson.getArrayItem(item, I_TYPE)->valueint) {
|
switch ( aJson.getArrayItem(item, I_TYPE)->valueint) {
|
||||||
case CH_THERMO:
|
case CH_THERMO:
|
||||||
@@ -462,7 +462,7 @@ void onMQTTConnect(){
|
|||||||
//strncpy_P(topic, outprefix, sizeof(topic));
|
//strncpy_P(topic, outprefix, sizeof(topic));
|
||||||
setTopic(topic,sizeof(topic),T_DEV);
|
setTopic(topic,sizeof(topic),T_DEV);
|
||||||
strncat_P(topic, nodes_P, sizeof(topic));
|
strncat_P(topic, nodes_P, sizeof(topic));
|
||||||
mqttClient.publish(topic,buf,true);
|
/// mqttClient.publish(topic,buf,true);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -817,7 +817,7 @@ void applyConfig() {
|
|||||||
aJsonObject *dmxoutArr = aJson.getObjectItem(root, "dmx");
|
aJsonObject *dmxoutArr = aJson.getObjectItem(root, "dmx");
|
||||||
if (dmxoutArr && aJson.getArraySize(dmxoutArr) >=1 ) {
|
if (dmxoutArr && aJson.getArraySize(dmxoutArr) >=1 ) {
|
||||||
DMXoutSetup(maxChannels = aJson.getArrayItem(dmxoutArr, 1)->valueint);
|
DMXoutSetup(maxChannels = aJson.getArrayItem(dmxoutArr, 1)->valueint);
|
||||||
debugSerial<<F("DMX out started. Channels: ")<<maxChannels;
|
debugSerial<<F("DMX out started. Channels: ")<<maxChannels<<endl;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef _modbus
|
#ifdef _modbus
|
||||||
@@ -854,6 +854,7 @@ void applyConfig() {
|
|||||||
Item it(item);
|
Item it(item);
|
||||||
if (it.isValid()) {
|
if (it.isValid()) {
|
||||||
int pin=it.getArg();
|
int pin=it.getArg();
|
||||||
|
if (pin<0) pin=-pin;
|
||||||
int cmd = it.getCmd();
|
int cmd = it.getCmd();
|
||||||
switch (it.itemType) {
|
switch (it.itemType) {
|
||||||
case CH_THERMO:
|
case CH_THERMO:
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ int owSetup(owChangedType owCh) {
|
|||||||
//// todo - move memory allocation to here
|
//// todo - move memory allocation to here
|
||||||
if (net) return true; // Already initialized
|
if (net) return true; // Already initialized
|
||||||
#ifdef DS2482_100_I2C_TO_1W_BRIDGE
|
#ifdef DS2482_100_I2C_TO_1W_BRIDGE
|
||||||
debugSerial<<F("DS2482_100_I2C_TO_1W_BRIDGE init");
|
debugSerial<<F("DS2482_100_I2C_TO_1W_BRIDGE init")<<endl;
|
||||||
net = new OneWire;
|
net = new OneWire;
|
||||||
#else
|
#else
|
||||||
debugSerial.print(F("One wire setup on PIN:"));
|
debugSerial.print(F("One wire setup on PIN:"));
|
||||||
|
|||||||
Reference in New Issue
Block a user