Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamline correction settings #2265

Merged
merged 9 commits into from
May 31, 2020
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions code/espurna/config/sensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,10 @@
#define SENSOR_POWER_CHECK_STATUS 1 // If set to 1 the reported power/current/energy will be 0 if the relay[0] is OFF
#endif

#ifndef SENSOR_TEMPERATURE_CORRECTION
#define SENSOR_TEMPERATURE_CORRECTION 0.0 // Offset correction
#endif

#ifndef TEMPERATURE_MIN_CHANGE
#define TEMPERATURE_MIN_CHANGE 0.0 // Minimum temperature change to report
#endif

#ifndef SENSOR_HUMIDITY_CORRECTION
#define SENSOR_HUMIDITY_CORRECTION 0.0 // Offset correction
#endif

#ifndef HUMIDITY_MIN_CHANGE
#define HUMIDITY_MIN_CHANGE 0.0 // Minimum humidity change to report
#endif
Expand Down Expand Up @@ -89,6 +81,25 @@
#define SENSOR_POWER_UNITS POWER_WATTS // Power units (POWER_WATTS | POWER_KILOWATTS)
#endif

// -----------------------------------------------------------------------------
// Magnitude offset correction
// -----------------------------------------------------------------------------

#ifndef SENSOR_TEMPERATURE_CORRECTION
#define SENSOR_TEMPERATURE_CORRECTION 0.0
#endif

#ifndef SENSOR_HUMIDITY_CORRECTION
#define SENSOR_HUMIDITY_CORRECTION 0.0
#endif

#ifndef SENSOR_PRESSURE_CORRECTION
#define SENSOR_PRESSURE_CORRECTION 0.0
#endif

#ifndef SENSOR_LUX_CORRECTION
#define SENSOR_LUX_CORRECTION 0.0
#endif

// =============================================================================
// Specific data for each sensor
Expand Down Expand Up @@ -771,10 +782,6 @@
// Enable support by passing LDR_SUPPORT=1 build flag
//------------------------------------------------------------------------------

#ifndef SENSOR_LUX_CORRECTION
#define SENSOR_LUX_CORRECTION 0.0 // Offset correction
#endif

#ifndef LDR_SUPPORT
#define LDR_SUPPORT 0
#endif
Expand Down
3 changes: 3 additions & 0 deletions code/espurna/config/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@
#define SENSOR_ERROR_GPIO_USED 7 // The GPIO is already in use
#define SENSOR_ERROR_CALIBRATION 8 // Calibration error or Not calibrated
#define SENSOR_ERROR_OTHER 99 // Any other error

#define SENSOR_ERROR_MAX 9

//------------------------------------------------------------------------------
// Telnet server
//------------------------------------------------------------------------------
Expand Down
Binary file modified code/espurna/data/index.all.html.gz
Binary file not shown.
Binary file modified code/espurna/data/index.curtain.html.gz
Binary file not shown.
Binary file modified code/espurna/data/index.light.html.gz
Binary file not shown.
Binary file modified code/espurna/data/index.lightfox.html.gz
Binary file not shown.
Binary file modified code/espurna/data/index.rfbridge.html.gz
Binary file not shown.
Binary file modified code/espurna/data/index.rfm69.html.gz
Binary file not shown.
Binary file modified code/espurna/data/index.sensor.html.gz
Binary file not shown.
Binary file modified code/espurna/data/index.small.html.gz
Binary file not shown.
Binary file modified code/espurna/data/index.thermostat.html.gz
Binary file not shown.
1 change: 1 addition & 0 deletions code/espurna/relay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,7 @@ void _relayWebSocketUpdate(JsonObject& root) {
JsonArray& status = state.createNestedArray("status");
JsonArray& lock = state.createNestedArray("lock");

// Note: we use byte instead of bool to ever so slightly compress json output
for (unsigned char i=0; i<relayCount(); i++) {
status.add<uint8_t>(_relays[i].target_status);
lock.add(_relays[i].lock);
Expand Down
Loading