initial commit with refactored mqtt commands

This commit is contained in:
proddy
2020-08-03 23:14:43 +02:00
parent 56c4e043fe
commit 6154ff38f2
41 changed files with 1208 additions and 1351 deletions

View File

@@ -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