Browse Source

Merge branch 'dev' of github.com:xoseperez/espurna into dev

webui
Xose Pérez 6 years ago
parent
commit
0b25a0569d
3 changed files with 13 additions and 2 deletions
  1. +8
    -0
      code/espurna/config/general.h
  2. +2
    -2
      code/espurna/homeassistant.ino
  3. +3
    -0
      code/espurna/sensors/PMSX003Sensor.h

+ 8
- 0
code/espurna/config/general.h View File

@ -919,6 +919,14 @@
#define HOMEASSISTANT_PAYLOAD_OFF "0" // Payload for OFF and unavailable messages #define HOMEASSISTANT_PAYLOAD_OFF "0" // Payload for OFF and unavailable messages
#endif #endif
#ifndef HOMEASSISTANT_PAYLOAD_AVAILABLE
#define HOMEASSISTANT_PAYLOAD_AVAILABLE "1" // Payload for available messages
#endif
#ifndef HOMEASSISTANT_PAYLOAD_NOT_AVAILABLE
#define HOMEASSISTANT_PAYLOAD_NOT_AVAILABLE "0" // Payload for available messages
#endif
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// INFLUXDB // INFLUXDB
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------


+ 2
- 2
code/espurna/homeassistant.ino View File

@ -87,8 +87,8 @@ void _haSendSwitch(unsigned char i, JsonObject& config) {
config["payload_on"] = String(HOMEASSISTANT_PAYLOAD_ON); config["payload_on"] = String(HOMEASSISTANT_PAYLOAD_ON);
config["payload_off"] = String(HOMEASSISTANT_PAYLOAD_OFF); config["payload_off"] = String(HOMEASSISTANT_PAYLOAD_OFF);
config["availability_topic"] = mqttTopic(MQTT_TOPIC_STATUS, false); config["availability_topic"] = mqttTopic(MQTT_TOPIC_STATUS, false);
config["payload_available"] = String(HOMEASSISTANT_PAYLOAD_ON);
config["payload_not_available"] = String(HOMEASSISTANT_PAYLOAD_OFF);
config["payload_available"] = String(HOMEASSISTANT_PAYLOAD_AVAILABLE);
config["payload_not_available"] = String(HOMEASSISTANT_PAYLOAD_NOT_AVAILABLE);
} }
#if LIGHT_PROVIDER != LIGHT_PROVIDER_NONE #if LIGHT_PROVIDER != LIGHT_PROVIDER_NONE


+ 3
- 0
code/espurna/sensors/PMSX003Sensor.h View File

@ -295,6 +295,9 @@ class PMSX003Sensor : public BaseSensor, PMSX003 {
} }
} else { } else {
readCycle = -1; readCycle = -1;
if (_readCount == 1) {
wakeUp();
}
} }
#endif #endif


Loading…
Cancel
Save