mirror of
https://github.com/wled/WLED.git
synced 2025-07-24 19:26:40 +00:00
Fix up BME280_v2 usermod
Minor compile correctness tweak
This commit is contained in:
parent
2431f2058b
commit
d0b599781d
@ -239,7 +239,7 @@ public:
|
|||||||
// from the UI and values read from sensor, then publish to broker
|
// from the UI and values read from sensor, then publish to broker
|
||||||
if (temperature != lastTemperature || PublishAlways)
|
if (temperature != lastTemperature || PublishAlways)
|
||||||
{
|
{
|
||||||
publishMqtt("temperature", String(temperature, TemperatureDecimals).c_str());
|
publishMqtt("temperature", String(temperature, (unsigned) TemperatureDecimals).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
lastTemperature = temperature; // Update last sensor temperature for next loop
|
lastTemperature = temperature; // Update last sensor temperature for next loop
|
||||||
@ -252,17 +252,17 @@ public:
|
|||||||
|
|
||||||
if (humidity != lastHumidity || PublishAlways)
|
if (humidity != lastHumidity || PublishAlways)
|
||||||
{
|
{
|
||||||
publishMqtt("humidity", String(humidity, HumidityDecimals).c_str());
|
publishMqtt("humidity", String(humidity, (unsigned) HumidityDecimals).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (heatIndex != lastHeatIndex || PublishAlways)
|
if (heatIndex != lastHeatIndex || PublishAlways)
|
||||||
{
|
{
|
||||||
publishMqtt("heat_index", String(heatIndex, TemperatureDecimals).c_str());
|
publishMqtt("heat_index", String(heatIndex, (unsigned) TemperatureDecimals).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dewPoint != lastDewPoint || PublishAlways)
|
if (dewPoint != lastDewPoint || PublishAlways)
|
||||||
{
|
{
|
||||||
publishMqtt("dew_point", String(dewPoint, TemperatureDecimals).c_str());
|
publishMqtt("dew_point", String(dewPoint, (unsigned) TemperatureDecimals).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
lastHumidity = humidity;
|
lastHumidity = humidity;
|
||||||
@ -279,7 +279,7 @@ public:
|
|||||||
|
|
||||||
if (pressure != lastPressure || PublishAlways)
|
if (pressure != lastPressure || PublishAlways)
|
||||||
{
|
{
|
||||||
publishMqtt("pressure", String(pressure, PressureDecimals).c_str());
|
publishMqtt("pressure", String(pressure, (unsigned) PressureDecimals).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
lastPressure = pressure;
|
lastPressure = pressure;
|
||||||
|
@ -22,7 +22,6 @@ Dependencies
|
|||||||
- Libraries
|
- Libraries
|
||||||
- `BME280@~3.0.0` (by [finitespace](https://github.com/finitespace/BME280))
|
- `BME280@~3.0.0` (by [finitespace](https://github.com/finitespace/BME280))
|
||||||
- `Wire`
|
- `Wire`
|
||||||
- These must be added under `lib_deps` in your `platform.ini` (or `platform_override.ini`).
|
|
||||||
- Data is published over MQTT - make sure you've enabled the MQTT sync interface.
|
- Data is published over MQTT - make sure you've enabled the MQTT sync interface.
|
||||||
- This usermod also writes to serial (GPIO1 on ESP8266). Please make sure nothing else is listening to the serial TX pin or your board will get confused by log messages!
|
- This usermod also writes to serial (GPIO1 on ESP8266). Please make sure nothing else is listening to the serial TX pin or your board will get confused by log messages!
|
||||||
|
|
||||||
@ -40,17 +39,11 @@ Methods also exist to read the read/calculated values from other WLED modules th
|
|||||||
|
|
||||||
# Compiling
|
# Compiling
|
||||||
|
|
||||||
To enable, compile with `USERMOD_BME280` defined (e.g. in `platformio_override.ini`)
|
To enable, add `BME280_v2` to your `custom_usermods` (e.g. in `platformio_override.ini`)
|
||||||
```ini
|
```ini
|
||||||
[env:usermod_bme280_d1_mini]
|
[env:usermod_bme280_d1_mini]
|
||||||
extends = env:d1_mini
|
extends = env:d1_mini
|
||||||
build_flags =
|
custom_usermods = ${env:d1_mini.custom_usermods} BME280_v2
|
||||||
${common.build_flags_esp8266}
|
|
||||||
-D USERMOD_BME280
|
|
||||||
lib_deps =
|
|
||||||
${esp8266.lib_deps}
|
|
||||||
BME280@~3.0.0
|
|
||||||
Wire
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user