mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-26 16:49:11 +03:00
rename txenabled to txpause
This commit is contained in:
@@ -40,6 +40,7 @@ For more details go to [docs.emsesp.org](https://docs.emsesp.org/).
|
|||||||
- added RTL8201 to eth phy list [#2800](https://github.com/emsesp/EMS-ESP32/issues/2800)
|
- added RTL8201 to eth phy list [#2800](https://github.com/emsesp/EMS-ESP32/issues/2800)
|
||||||
- added partitions to Web UI Version page, so previous firmware versions can be installed [#2837](https://github.com/emsesp/EMS-ESP32/issues/2837)
|
- added partitions to Web UI Version page, so previous firmware versions can be installed [#2837](https://github.com/emsesp/EMS-ESP32/issues/2837)
|
||||||
- button pressures show LED. On a long press (10 seconds) the LED flashes for 5 seconds to indicate a factory reset is about to happen. [#2848](https://github.com/emsesp/EMS-ESP32/issues/2848)
|
- button pressures show LED. On a long press (10 seconds) the LED flashes for 5 seconds to indicate a factory reset is about to happen. [#2848](https://github.com/emsesp/EMS-ESP32/issues/2848)
|
||||||
|
- added `txpause` command to pause the TX, by setting Txmode to 0 (disabled) [#2850](https://github.com/emsesp/EMS-ESP32/issues/2850)
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|
||||||
|
|||||||
@@ -1047,7 +1047,7 @@ void System::commands_init() {
|
|||||||
Command::add(EMSdevice::DeviceType::SYSTEM, F_(fetch), System::command_fetch, FL_(fetch_cmd), CommandFlag::ADMIN_ONLY);
|
Command::add(EMSdevice::DeviceType::SYSTEM, F_(fetch), System::command_fetch, FL_(fetch_cmd), CommandFlag::ADMIN_ONLY);
|
||||||
Command::add(EMSdevice::DeviceType::SYSTEM, F_(restart), System::command_restart, FL_(restart_cmd), CommandFlag::ADMIN_ONLY);
|
Command::add(EMSdevice::DeviceType::SYSTEM, F_(restart), System::command_restart, FL_(restart_cmd), CommandFlag::ADMIN_ONLY);
|
||||||
Command::add(EMSdevice::DeviceType::SYSTEM, F_(format), System::command_format, FL_(format_cmd), CommandFlag::ADMIN_ONLY);
|
Command::add(EMSdevice::DeviceType::SYSTEM, F_(format), System::command_format, FL_(format_cmd), CommandFlag::ADMIN_ONLY);
|
||||||
Command::add(EMSdevice::DeviceType::SYSTEM, F_(txenabled), System::command_txenabled, FL_(txenabled_cmd), CommandFlag::ADMIN_ONLY);
|
Command::add(EMSdevice::DeviceType::SYSTEM, F_(txpause), System::command_txpause, FL_(txpause_cmd), CommandFlag::ADMIN_ONLY);
|
||||||
Command::add(EMSdevice::DeviceType::SYSTEM, F_(watch), System::command_watch, FL_(watch_cmd));
|
Command::add(EMSdevice::DeviceType::SYSTEM, F_(watch), System::command_watch, FL_(watch_cmd));
|
||||||
Command::add(EMSdevice::DeviceType::SYSTEM, F_(message), System::command_message, FL_(message_cmd));
|
Command::add(EMSdevice::DeviceType::SYSTEM, F_(message), System::command_message, FL_(message_cmd));
|
||||||
#if defined(EMSESP_TEST)
|
#if defined(EMSESP_TEST)
|
||||||
@@ -1107,9 +1107,8 @@ void System::led_monitor() {
|
|||||||
} else if (led_flash_step_ % 2) {
|
} else if (led_flash_step_ % 2) {
|
||||||
// handle the step events (on odd numbers 3,5,7,etc). see if we need to turn on a LED
|
// handle the step events (on odd numbers 3,5,7,etc). see if we need to turn on a LED
|
||||||
// 1 flash (blue) is the EMS bus is not connected
|
// 1 flash (blue) is the EMS bus is not connected
|
||||||
// 2 flashes (red) if the network (wifi or ethernet) is not connected
|
// 2 flashes (red, red) if the network (wifi or ethernet) is not connected
|
||||||
// 3 flashes (red, red, blue) is both the bus and the network are not connected
|
// 3 flashes (red, red, blue) is both the bus and the network are not connected
|
||||||
|
|
||||||
bool no_network = (healthcheck_ & HEALTHCHECK_NO_NETWORK) == HEALTHCHECK_NO_NETWORK;
|
bool no_network = (healthcheck_ & HEALTHCHECK_NO_NETWORK) == HEALTHCHECK_NO_NETWORK;
|
||||||
bool no_bus = (healthcheck_ & HEALTHCHECK_NO_BUS) == HEALTHCHECK_NO_BUS;
|
bool no_bus = (healthcheck_ & HEALTHCHECK_NO_BUS) == HEALTHCHECK_NO_BUS;
|
||||||
|
|
||||||
@@ -2435,27 +2434,34 @@ bool System::load_board_profile(std::vector<int8_t> & data, const std::string &
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// txenabled command - temporarily pause the TX, setting Txmode to 0
|
// txpause command - temporarily pause the TX, by setting Txmode to 0 (disabled)
|
||||||
bool System::command_txenabled(const char * value, const int8_t id) {
|
bool System::command_txpause(const char * value, const int8_t id) {
|
||||||
bool arg;
|
bool arg;
|
||||||
if (!Helpers::value2bool(value, arg)) {
|
if (!Helpers::value2bool(value, arg)) {
|
||||||
return false; // argument not recognized
|
return false; // argument not recognized
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arg) {
|
if (!arg) {
|
||||||
// Tx mode on
|
// arg = false: Tx mode to 0 (disabled) to pause
|
||||||
// if the TX mode was off, revert back to the saved setting
|
|
||||||
if (EMSbus::tx_mode() == EMS_TXMODE_OFF) {
|
if (EMSbus::tx_mode() == EMS_TXMODE_OFF) {
|
||||||
EMSESP::webSettingsService.read([&](WebSettings & settings) {
|
EMSESP::webSettingsService.read([&](WebSettings & settings) {
|
||||||
EMSbus::tx_mode(settings.tx_mode);
|
EMSbus::tx_mode(settings.tx_mode);
|
||||||
|
#ifdef EMSESP_DEBUG
|
||||||
LOG_INFO("TX mode restored (value %d)", settings.tx_mode);
|
LOG_INFO("TX mode restored (value %d)", settings.tx_mode);
|
||||||
|
#else
|
||||||
|
LOG_INFO("TX active");
|
||||||
|
#endif
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Tx mode off
|
// pause = true: Tx mode to 0 (disabled) to pause
|
||||||
if (EMSbus::tx_mode() != EMS_TXMODE_OFF) {
|
if (EMSbus::tx_mode() != EMS_TXMODE_OFF) {
|
||||||
EMSbus::tx_mode(EMS_TXMODE_OFF);
|
EMSbus::tx_mode(EMS_TXMODE_OFF);
|
||||||
|
#ifdef EMSESP_DEBUG
|
||||||
LOG_INFO("TX mode set to OFF (value %d)", EMS_TXMODE_OFF);
|
LOG_INFO("TX mode set to OFF (value %d)", EMS_TXMODE_OFF);
|
||||||
|
#else
|
||||||
|
LOG_INFO("TX paused");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class System {
|
|||||||
static bool command_info(const char * value, const int8_t id, JsonObject output);
|
static bool command_info(const char * value, const int8_t id, JsonObject output);
|
||||||
static bool command_response(const char * value, const int8_t id, JsonObject output);
|
static bool command_response(const char * value, const int8_t id, JsonObject output);
|
||||||
static bool command_service(const char * cmd, const char * value);
|
static bool command_service(const char * cmd, const char * value);
|
||||||
static bool command_txenabled(const char * value, const int8_t id);
|
static bool command_txpause(const char * value, const int8_t id);
|
||||||
|
|
||||||
static bool get_value_info(JsonObject root, const char * cmd);
|
static bool get_value_info(JsonObject root, const char * cmd);
|
||||||
static void get_value_json(JsonObject output, const std::string & circuit, const std::string & name, JsonVariant val);
|
static void get_value_json(JsonObject output, const std::string & circuit, const std::string & name, JsonVariant val);
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ Authorization: Bearer {{token}}
|
|||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
POST {{host_dev}}/api/system/txenabled
|
POST {{host_dev}}/api/system/txpause
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
Authorization: Bearer {{token}}
|
Authorization: Bearer {{token}}
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ Authorization: Bearer {{token}}
|
|||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
POST {{host_dev}}/api/system/txenabled
|
POST {{host_dev}}/api/system/txpause
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
Authorization: Bearer {{token}}
|
Authorization: Bearer {{token}}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user