mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
initial commit with refactored mqtt commands
This commit is contained in:
@@ -16,13 +16,11 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// code written by nomis - https://github.com/nomis
|
||||
// code originally written by nomis - https://github.com/nomis
|
||||
|
||||
#include "sensors.h"
|
||||
#include "emsesp.h"
|
||||
|
||||
MAKE_PSTR(logger_name, "sensors")
|
||||
|
||||
#ifdef ESP32
|
||||
#define YIELD
|
||||
#else
|
||||
@@ -31,7 +29,7 @@ MAKE_PSTR(logger_name, "sensors")
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
uuid::log::Logger Sensors::logger_{F_(logger_name), uuid::log::Facility::DAEMON};
|
||||
uuid::log::Logger Sensors::logger_{F_(sensors), uuid::log::Facility::DAEMON};
|
||||
|
||||
void Sensors::start() {
|
||||
// copy over values from MQTT so we don't keep on quering the filesystem
|
||||
@@ -206,7 +204,7 @@ float Sensors::get_temperature_c(const uint8_t addr[]) {
|
||||
break;
|
||||
}
|
||||
|
||||
uint32_t raw = (raw_value *625) / 100; // round to 0.01
|
||||
uint32_t raw = (raw_value * 625) / 100; // round to 0.01
|
||||
return (float)raw / 100;
|
||||
#else
|
||||
return NAN;
|
||||
@@ -303,4 +301,4 @@ void Sensors::publish_values() {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace emsesp
|
||||
} // namespace emsesp
|
||||
Reference in New Issue
Block a user