Fix up BME280_v2 usermod
Minor compile correctness tweak
This commit is contained in:
		| @@ -239,7 +239,7 @@ public: | ||||
|         // from the UI and values read from sensor, then publish to broker | ||||
|         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 | ||||
| @@ -252,17 +252,17 @@ public: | ||||
|  | ||||
|           if (humidity != lastHumidity || PublishAlways) | ||||
|           { | ||||
|             publishMqtt("humidity", String(humidity, HumidityDecimals).c_str()); | ||||
|             publishMqtt("humidity", String(humidity, (unsigned) HumidityDecimals).c_str()); | ||||
|           } | ||||
|  | ||||
|           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) | ||||
|           { | ||||
|             publishMqtt("dew_point", String(dewPoint, TemperatureDecimals).c_str()); | ||||
|             publishMqtt("dew_point", String(dewPoint, (unsigned) TemperatureDecimals).c_str()); | ||||
|           } | ||||
|  | ||||
|           lastHumidity = humidity; | ||||
| @@ -279,7 +279,7 @@ public: | ||||
|  | ||||
|         if (pressure != lastPressure || PublishAlways) | ||||
|         { | ||||
|           publishMqtt("pressure", String(pressure, PressureDecimals).c_str()); | ||||
|           publishMqtt("pressure", String(pressure, (unsigned) PressureDecimals).c_str()); | ||||
|         } | ||||
|  | ||||
|         lastPressure = pressure; | ||||
|   | ||||
| @@ -22,7 +22,6 @@ Dependencies | ||||
| - Libraries | ||||
|   - `BME280@~3.0.0` (by [finitespace](https://github.com/finitespace/BME280)) | ||||
|   - `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. | ||||
| - 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 | ||||
|  | ||||
| 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 | ||||
| [env:usermod_bme280_d1_mini] | ||||
| extends = env:d1_mini | ||||
| build_flags = | ||||
|   ${common.build_flags_esp8266} | ||||
|   -D USERMOD_BME280 | ||||
| lib_deps =  | ||||
|   ${esp8266.lib_deps} | ||||
|   BME280@~3.0.0 | ||||
|   Wire | ||||
| custom_usermods = ${env:d1_mini.custom_usermods} BME280_v2 | ||||
| ``` | ||||
|  | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Will Miles
					Will Miles