Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Change default update interval to 60 seconds #356

Merged
merged 1 commit into from Jan 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
66 changes: 33 additions & 33 deletions src/esphomelib/application.h
Expand Up @@ -482,13 +482,13 @@ class Application {
MakeDHTSensor make_dht_sensor(const std::string &temperature_friendly_name,
const std::string &humidity_friendly_name,
const GPIOOutputPin &pin,
uint32_t update_interval = 15000);
uint32_t update_interval = 60000);
#endif

#ifdef USE_DALLAS_SENSOR
sensor::DallasComponent *make_dallas_component(ESPOneWire *one_wire, uint32_t update_interval = 15000);
sensor::DallasComponent *make_dallas_component(ESPOneWire *one_wire, uint32_t update_interval = 60000);

sensor::DallasComponent *make_dallas_component(const GPIOOutputPin &pin, uint32_t update_interval = 15000);
sensor::DallasComponent *make_dallas_component(const GPIOOutputPin &pin, uint32_t update_interval = 60000);
#endif

#ifdef USE_PULSE_COUNTER_SENSOR
Expand All @@ -510,7 +510,7 @@ class Application {
*/
MakePulseCounterSensor make_pulse_counter_sensor(const std::string &friendly_name,
const GPIOInputPin &pin,
uint32_t update_interval = 15000);
uint32_t update_interval = 60000);
#endif

#ifdef USE_ADC_SENSOR
Expand All @@ -532,7 +532,7 @@ class Application {
*/
MakeADCSensor make_adc_sensor(const std::string &friendly_name,
uint8_t pin,
uint32_t update_interval = 15000);
uint32_t update_interval = 60000);
#endif

#ifdef USE_ADS1115_SENSOR
Expand Down Expand Up @@ -566,7 +566,7 @@ class Application {
*/
MakeBMP085Sensor make_bmp085_sensor(const std::string &temperature_friendly_name,
const std::string &pressure_friendly_name,
uint32_t update_interval = 15000);
uint32_t update_interval = 60000);
#endif

#ifdef USE_HTU21D_SENSOR
Expand All @@ -588,7 +588,7 @@ class Application {
*/
MakeHTU21DSensor make_htu21d_sensor(const std::string &temperature_friendly_name,
const std::string &humidity_friendly_name,
uint32_t update_interval = 15000);
uint32_t update_interval = 60000);
#endif

#ifdef USE_HDC1080_SENSOR
Expand All @@ -610,7 +610,7 @@ class Application {
*/
MakeHDC1080Sensor make_hdc1080_sensor(const std::string &temperature_friendly_name,
const std::string &humidity_friendly_name,
uint32_t update_interval = 15000);
uint32_t update_interval = 60000);
#endif

#ifdef USE_ULTRASONIC_SENSOR
Expand Down Expand Up @@ -645,7 +645,7 @@ class Application {
sensor::MQTTSensorComponent *mqtt;
};

MakeWiFiSignalSensor make_wifi_signal_sensor(const std::string &name, uint32_t update_interval = 15000);
MakeWiFiSignalSensor make_wifi_signal_sensor(const std::string &name, uint32_t update_interval = 60000);
#endif

#ifdef USE_MPU6050
Expand All @@ -660,7 +660,7 @@ class Application {
* @param update_interval The interval in ms to update the sensor values.
* @return An MPU6050Component, use this to create the individual sensors and register them with `register_sensor`.
*/
sensor::MPU6050Component *make_mpu6050_sensor(uint8_t address = 0x68, uint32_t update_interval = 15000);
sensor::MPU6050Component *make_mpu6050_sensor(uint8_t address = 0x68, uint32_t update_interval = 60000);
#endif

#ifdef USE_TSL2561
Expand Down Expand Up @@ -689,7 +689,7 @@ class Application {
* @return The TSL2561Sensor + MQTT sensor pair, use this for advanced settings.
*/
MakeTSL2561Sensor make_tsl2561_sensor(const std::string &name, uint8_t address = 0x23,
uint32_t update_interval = 15000);
uint32_t update_interval = 60000);
#endif

#ifdef USE_BH1750
Expand All @@ -712,7 +712,7 @@ class Application {
* @return The BH1750Sensor + MQTT sensor pair, use this for advanced settings.
*/
MakeBH1750Sensor make_bh1750_sensor(const std::string &name, uint8_t address = 0x23,
uint32_t update_interval = 15000);
uint32_t update_interval = 60000);
#endif

#ifdef USE_BME280
Expand All @@ -734,7 +734,7 @@ class Application {
*/
MakeBME280Sensor make_bme280_sensor(const std::string &temperature_name, const std::string &pressure_name,
const std::string &humidity_name,
uint8_t address = 0x77, uint32_t update_interval = 15000);
uint8_t address = 0x77, uint32_t update_interval = 60000);
#endif

#ifdef USE_BMP280
Expand All @@ -753,7 +753,7 @@ class Application {
* @return The BME280Component + MQTT sensors tuple, use this for advanced settings.
*/
MakeBMP280Sensor make_bmp280_sensor(const std::string &temperature_name, const std::string &pressure_name,
uint8_t address = 0x77, uint32_t update_interval = 15000);
uint8_t address = 0x77, uint32_t update_interval = 60000);
#endif

#ifdef USE_BME680
Expand All @@ -767,7 +767,7 @@ class Application {

MakeBME680Sensor make_bme680_sensor(const std::string &temperature_name, const std::string &pressure_name,
const std::string &humidity_name, const std::string &gas_resistance_name,
uint8_t address = 0x76, uint32_t update_interval = 15000);
uint8_t address = 0x76, uint32_t update_interval = 60000);
#endif

#ifdef USE_SHT3XD
Expand All @@ -778,7 +778,7 @@ class Application {
};

MakeSHT3XDSensor make_sht3xd_sensor(const std::string &temperature_name, const std::string &humidity_name,
uint8_t address = 0x44, uint32_t update_interval = 15000);
uint8_t address = 0x44, uint32_t update_interval = 60000);
#endif

#ifdef USE_DHT12_SENSOR
Expand All @@ -789,7 +789,7 @@ class Application {
};

MakeDHT12Sensor make_dht12_sensor(const std::string &temperature_name, const std::string &humidity_name,
uint32_t update_interval = 15000);
uint32_t update_interval = 60000);
#endif

#ifdef USE_ROTARY_ENCODER_SENSOR
Expand Down Expand Up @@ -829,7 +829,7 @@ class Application {
sensor::MQTTSensorComponent *mqtt;
};

MakeTemplateSensor make_template_sensor(const std::string &name, uint32_t update_interval = 15000);
MakeTemplateSensor make_template_sensor(const std::string &name, uint32_t update_interval = 60000);
#endif

#ifdef USE_MAX31855_SENSOR
Expand All @@ -839,7 +839,7 @@ class Application {
};

MakeMAX31855Sensor make_max31855_sensor(const std::string &name, SPIComponent *spi_bus, const GPIOOutputPin &cs,
uint32_t update_interval = 15000);
uint32_t update_interval = 60000);
#endif

#ifdef USE_MAX6675_SENSOR
Expand All @@ -849,7 +849,7 @@ class Application {
};

MakeMAX6675Sensor make_max6675_sensor(const std::string &name, SPIComponent *spi_bus, const GPIOOutputPin &cs,
uint32_t update_interval = 15000);
uint32_t update_interval = 60000);
#endif

#ifdef USE_ESP32_HALL_SENSOR
Expand All @@ -858,7 +858,7 @@ class Application {
sensor::MQTTSensorComponent *mqtt;
};

MakeESP32HallSensor make_esp32_hall_sensor(const std::string &name, uint32_t update_interval = 15000);
MakeESP32HallSensor make_esp32_hall_sensor(const std::string &name, uint32_t update_interval = 60000);
#endif

#ifdef USE_DUTY_CYCLE_SENSOR
Expand All @@ -868,7 +868,7 @@ class Application {
};

MakeDutyCycleSensor make_duty_cycle_sensor(const std::string &name, const GPIOInputPin &pin,
uint32_t update_interval = 15000);
uint32_t update_interval = 60000);
#endif

#ifdef USE_MHZ19
Expand All @@ -878,7 +878,7 @@ class Application {
};

MakeMHZ19Sensor make_mhz19_sensor(UARTComponent *parent, const std::string &co2_name,
uint32_t update_interval = 15000);
uint32_t update_interval = 60000);
#endif

#ifdef USE_UPTIME_SENSOR
Expand All @@ -887,20 +887,20 @@ class Application {
sensor::MQTTSensorComponent *mqtt;
};

MakeUptimeSensor make_uptime_sensor(const std::string &name, uint32_t update_interval = 15000);
MakeUptimeSensor make_uptime_sensor(const std::string &name, uint32_t update_interval = 60000);
#endif

#ifdef USE_INA219
sensor::INA219Component *make_ina219(float shunt_resistance_ohm, float max_current_a, float max_voltage_v,
uint8_t address = 0x40, uint32_t update_interval = 15000);
uint8_t address = 0x40, uint32_t update_interval = 60000);
#endif

#ifdef USE_INA3221
sensor::INA3221Component *make_ina3221(uint8_t address = 0x40, uint32_t update_interval = 15000);
sensor::INA3221Component *make_ina3221(uint8_t address = 0x40, uint32_t update_interval = 60000);
#endif

#ifdef USE_HMC5883L
sensor::HMC5883LComponent *make_hmc5883l(uint32_t update_interval = 15000);
sensor::HMC5883LComponent *make_hmc5883l(uint32_t update_interval = 60000);
#endif

#ifdef USE_HX711
Expand All @@ -910,7 +910,7 @@ class Application {
};

MakeHX711Sensor make_hx711_sensor(const std::string &name, const GPIOInputPin &dout, const GPIOOutputPin &sck,
uint32_t update_interval = 15000);
uint32_t update_interval = 60000);
#endif

#ifdef USE_MS5611
Expand All @@ -921,11 +921,11 @@ class Application {
};

MakeMS5611Sensor make_ms5611_sensor(const std::string &temperature_name, const std::string &pressure_name,
uint32_t update_interval = 15000);
uint32_t update_interval = 60000);
#endif

#ifdef USE_TCS34725
sensor::TCS34725Component *make_tcs34725(uint32_t update_interval = 15000);
sensor::TCS34725Component *make_tcs34725(uint32_t update_interval = 60000);
#endif

#ifdef USE_SNTP_COMPONENT
Expand All @@ -937,7 +937,7 @@ class Application {
#endif

#ifdef USE_HLW8012
sensor::HLW8012Component *make_hlw8012(const GPIOOutputPin &sel_pin, uint8_t cf_pin, uint8_t cf1_pin, uint32_t update_interval = 15000);
sensor::HLW8012Component *make_hlw8012(const GPIOOutputPin &sel_pin, uint8_t cf_pin, uint8_t cf1_pin, uint32_t update_interval = 60000);
#endif

#ifdef USE_MQTT_SUBSCRIBE_SENSOR
Expand All @@ -959,7 +959,7 @@ class Application {
#endif

#ifdef USE_CSE7766
sensor::CSE7766Component *make_cse7766(UARTComponent *parent, uint32_t update_interval = 15000);
sensor::CSE7766Component *make_cse7766(UARTComponent *parent, uint32_t update_interval = 60000);
#endif


Expand Down Expand Up @@ -996,7 +996,7 @@ class Application {
text_sensor::MQTTTextSensor *mqtt;
};

MakeTemplateTextSensor make_template_text_sensor(const std::string &name, uint32_t update_interval = 15000);
MakeTemplateTextSensor make_template_text_sensor(const std::string &name, uint32_t update_interval = 60000);
#endif

#ifdef USE_PMSX003
Expand Down
2 changes: 1 addition & 1 deletion src/esphomelib/mqtt/mqtt_client_component.cpp
Expand Up @@ -197,7 +197,7 @@ bool MQTTClientComponent::is_connected() {

void MQTTClientComponent::check_connected() {
if (!this->mqtt_client_.connected()) {
if (millis() - this->connect_begin_ > 15000) {
if (millis() - this->connect_begin_ > 60000) {
this->state_ = MQTT_CLIENT_DISCONNECTED;
this->start_dnslookup();
}
Expand Down
2 changes: 1 addition & 1 deletion src/esphomelib/sensor/adc.h
Expand Up @@ -26,7 +26,7 @@ namespace sensor {
class ADCSensorComponent : public PollingSensorComponent {
public:
/// Construct the ADCSensor with the provided pin and update interval in ms.
explicit ADCSensorComponent(const std::string &name, GPIOInputPin pin, uint32_t update_interval = 15000);
explicit ADCSensorComponent(const std::string &name, GPIOInputPin pin, uint32_t update_interval = 60000);

#ifdef ARDUINO_ARCH_ESP32
/// Set the attenuation for this pin. Only available on the ESP32.
Expand Down
2 changes: 1 addition & 1 deletion src/esphomelib/sensor/ads1115_component.h
Expand Up @@ -67,7 +67,7 @@ class ADS1115Component : public Component, public I2CDevice {
* @return An ADS1115Sensor, use this for advanced options.
*/
ADS1115Sensor *get_sensor(const std::string &name, ADS1115Multiplexer multiplexer, ADS1115Gain gain,
uint32_t update_interval = 15000);
uint32_t update_interval = 60000);

// ========== INTERNAL METHODS ==========
// (In most use cases you won't need these)
Expand Down
2 changes: 1 addition & 1 deletion src/esphomelib/sensor/bh1750_sensor.h
Expand Up @@ -23,7 +23,7 @@ enum BH1750Resolution {
class BH1750Sensor : public PollingSensorComponent, public I2CDevice {
public:
BH1750Sensor(I2CComponent *parent, const std::string &name,
uint8_t address = 0x23, uint32_t update_interval = 15000);
uint8_t address = 0x23, uint32_t update_interval = 60000);

/** Set the resolution of this sensor.
*
Expand Down
2 changes: 1 addition & 1 deletion src/esphomelib/sensor/bme280_component.h
Expand Up @@ -72,7 +72,7 @@ class BME280Component : public PollingComponent, public I2CDevice {
BME280Component(I2CComponent *parent,
const std::string &temperature_name, const std::string &pressure_name,
const std::string &humidity_name,
uint8_t address = 0x77, uint32_t update_interval = 15000);
uint8_t address = 0x77, uint32_t update_interval = 60000);

/// Set the oversampling value for the temperature sensor. Default is 16x.
void set_temperature_oversampling(BME280Oversampling temperature_over_sampling);
Expand Down
2 changes: 1 addition & 1 deletion src/esphomelib/sensor/bme680_component.h
Expand Up @@ -84,7 +84,7 @@ class BME680Component : public PollingComponent, public I2CDevice {
BME680Component(I2CComponent *parent,
const std::string &temperature_name, const std::string &pressure_name,
const std::string &humidity_name, const std::string &gas_resistance_name,
uint8_t address = 0x76, uint32_t update_interval = 15000);
uint8_t address = 0x76, uint32_t update_interval = 60000);

/// Set the temperature oversampling value. Defaults to 16X.
void set_temperature_oversampling(BME680Oversampling temperature_oversampling);
Expand Down
2 changes: 1 addition & 1 deletion src/esphomelib/sensor/bmp280_component.h
Expand Up @@ -63,7 +63,7 @@ class BMP280Component : public PollingComponent, public I2CDevice {
public:
BMP280Component(I2CComponent *parent,
const std::string &temperature_name, const std::string &pressure_name,
uint8_t address = 0x77, uint32_t update_interval = 15000);
uint8_t address = 0x77, uint32_t update_interval = 60000);

/// Set the oversampling value for the temperature sensor. Default is 16x.
void set_temperature_oversampling(BMP280Oversampling temperature_over_sampling);
Expand Down
2 changes: 1 addition & 1 deletion src/esphomelib/sensor/cse7766.h
Expand Up @@ -20,7 +20,7 @@ using CSE7766PowerSensor = EmptySensor<1, ICON_FLASH, UNIT_W>;

class CSE7766Component : public PollingComponent, public UARTDevice {
public:
CSE7766Component(UARTComponent *parent, uint32_t update_interval = 15000);
CSE7766Component(UARTComponent *parent, uint32_t update_interval = 60000);

CSE7766VoltageSensor *make_voltage_sensor(const std::string &name);

Expand Down
2 changes: 1 addition & 1 deletion src/esphomelib/sensor/dht12_component.h
Expand Up @@ -19,7 +19,7 @@ class DHT12Component : public PollingComponent, public I2CDevice {
public:
DHT12Component(I2CComponent *parent,
const std::string &temperature_name, const std::string &humidity_name,
uint32_t update_interval = 15000);
uint32_t update_interval = 60000);

// ========== INTERNAL METHODS ==========
// (In most use cases you won't need these)
Expand Down
2 changes: 1 addition & 1 deletion src/esphomelib/sensor/dht_component.h
Expand Up @@ -31,7 +31,7 @@ class DHTComponent : public PollingComponent {
* @param update_interval The interval in ms the sensor should be checked.
*/
DHTComponent(const std::string &temperature_name, const std::string &humidity_name,
GPIOPin *pin, uint32_t update_interval = 15000);
GPIOPin *pin, uint32_t update_interval = 60000);

/** Manually select the DHT model.
*
Expand Down
2 changes: 1 addition & 1 deletion src/esphomelib/sensor/duty_cycle_sensor.h
Expand Up @@ -13,7 +13,7 @@ namespace sensor {

class DutyCycleSensor : public PollingSensorComponent {
public:
DutyCycleSensor(const std::string &name, GPIOPin *pin, uint32_t update_interval = 15000);
DutyCycleSensor(const std::string &name, GPIOPin *pin, uint32_t update_interval = 60000);

void setup() override;
float get_setup_priority() const override;
Expand Down
2 changes: 1 addition & 1 deletion src/esphomelib/sensor/esp32_hall_sensor.h
Expand Up @@ -13,7 +13,7 @@ namespace sensor {

class ESP32HallSensor : public PollingSensorComponent {
public:
explicit ESP32HallSensor(const std::string &name, uint32_t update_interval = 15000);
explicit ESP32HallSensor(const std::string &name, uint32_t update_interval = 60000);

void dump_config() override;

Expand Down
2 changes: 1 addition & 1 deletion src/esphomelib/sensor/hlw8012.h
Expand Up @@ -33,7 +33,7 @@ using HLW8012PowerSensor = EmptyPollingParentSensor<1, ICON_FLASH, UNIT_W>;

class HLW8012Component : public PollingComponent {
public:
HLW8012Component(GPIOPin *sel_pin, uint8_t cf_pin, uint8_t cf1_pin, uint32_t update_interval = 15000);
HLW8012Component(GPIOPin *sel_pin, uint8_t cf_pin, uint8_t cf1_pin, uint32_t update_interval = 60000);

void setup() override;
void dump_config() override;
Expand Down
2 changes: 1 addition & 1 deletion src/esphomelib/sensor/hmc5883l.h
Expand Up @@ -28,7 +28,7 @@ using HMC5883LHeadingSensor = EmptyPollingParentSensor<1, ICON_SCREEN_ROTATION,

class HMC5883LComponent : public PollingComponent, public I2CDevice {
public:
HMC5883LComponent(I2CComponent *parent, uint32_t update_interval = 15000);
HMC5883LComponent(I2CComponent *parent, uint32_t update_interval = 60000);

void setup() override;
void dump_config() override;
Expand Down