rename reset_tx to init_tx

This commit is contained in:
proddy
2020-08-26 16:06:35 +02:00
parent c9371dce20
commit cf4a7daeac
2 changed files with 12 additions and 10 deletions

View File

@@ -141,14 +141,17 @@ void EMSESP::watch_id(uint16_t watch_id) {
// change the tx_mode
// resets all counters and bumps the UART
// this is called when the tx_mode is persisted in the FS either via Web UI or the console
void EMSESP::reset_tx() {
void EMSESP::init_tx() {
// get the tx_mode
uint8_t tx_mode;
EMSESP::emsespSettingsService.read([&](EMSESPSettings & settings) { tx_mode = settings.tx_mode; });
#ifndef EMSESP_FORCE_SERIAL
EMSuart::stop();
EMSuart::start(tx_mode);
txservice_.start();
#endif
txservice_.start(); // sends out request to EMS bus for all devices
// force a fetch for all new values, unless Tx is set to off
if (tx_mode != 0) {
@@ -789,7 +792,6 @@ void EMSESP::start() {
mqtt_.start(); // mqtt init
system_.start(); // starts syslog, uart, sets version, initializes LED. Requires pre-loaded settings.
shower_.start(); // initialize shower timer and shower alert
txservice_.start(); // sets bus ID, sends out request for EMS devices
sensors_.start(); // dallas external sensors
webServer.begin(); // start web server

View File

@@ -100,7 +100,7 @@ class EMSESP {
static void add_context_menus();
static void reset_tx();
static void init_tx();
static void incoming_telegram(uint8_t * data, const uint8_t length);