mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
formatting and text changes
This commit is contained in:
@@ -26,7 +26,6 @@ uuid::log::Logger Generic::logger_{F_(generic), uuid::log::Facility::CONSOLE};
|
|||||||
|
|
||||||
Generic::Generic(uint8_t device_type, uint8_t device_id, uint8_t product_id, const std::string & version, const std::string & name, uint8_t flags, uint8_t brand)
|
Generic::Generic(uint8_t device_type, uint8_t device_id, uint8_t product_id, const std::string & version, const std::string & name, uint8_t flags, uint8_t brand)
|
||||||
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
|
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
|
||||||
|
|
||||||
// RF-Sensor 0x40 sending temperature in telegram 0x435, see https://github.com/emsesp/EMS-ESP32/issues/103
|
// RF-Sensor 0x40 sending temperature in telegram 0x435, see https://github.com/emsesp/EMS-ESP32/issues/103
|
||||||
if (device_id == 0x40) {
|
if (device_id == 0x40) {
|
||||||
register_telegram_type(0x435, F("RFSensorMessage"), false, MAKE_PF_CB(process_RFSensorMessage));
|
register_telegram_type(0x435, F("RFSensorMessage"), false, MAKE_PF_CB(process_RFSensorMessage));
|
||||||
|
|||||||
@@ -680,7 +680,7 @@ void Thermostat::process_RC10Set(std::shared_ptr<const Telegram> telegram) {
|
|||||||
has_update(telegram->read_value(hc->nighttemp, 3));
|
has_update(telegram->read_value(hc->nighttemp, 3));
|
||||||
has_update(telegram->read_value(hc->daytemp, 4));
|
has_update(telegram->read_value(hc->daytemp, 4));
|
||||||
has_update(telegram->read_value(hc->reducehours, 5));
|
has_update(telegram->read_value(hc->reducehours, 5));
|
||||||
has_update(telegram->read_value(ibaBuildingType_ ,6));
|
has_update(telegram->read_value(ibaBuildingType_, 6));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 0xA8 - for reading the mode from the RC20 thermostat (0x17)
|
// 0xA8 - for reading the mode from the RC20 thermostat (0x17)
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ void Mqtt::loop() {
|
|||||||
void Mqtt::show_mqtt(uuid::console::Shell & shell) {
|
void Mqtt::show_mqtt(uuid::console::Shell & shell) {
|
||||||
shell.printfln(F("MQTT is %s"), connected() ? uuid::read_flash_string(F_(connected)).c_str() : uuid::read_flash_string(F_(disconnected)).c_str());
|
shell.printfln(F("MQTT is %s"), connected() ? uuid::read_flash_string(F_(connected)).c_str() : uuid::read_flash_string(F_(disconnected)).c_str());
|
||||||
|
|
||||||
shell.printfln(F("MQTT publish fails count: %lu"), mqtt_publish_fails_);
|
shell.printfln(F("MQTT publish errors: %lu"), mqtt_publish_fails_);
|
||||||
shell.println();
|
shell.println();
|
||||||
|
|
||||||
// show subscriptions
|
// show subscriptions
|
||||||
|
|||||||
@@ -59,9 +59,7 @@ void WebAPIService::webAPIService_post(AsyncWebServerRequest * request, JsonVari
|
|||||||
// parse the URL looking for query or path parameters
|
// parse the URL looking for query or path parameters
|
||||||
// reporting back any errors
|
// reporting back any errors
|
||||||
void WebAPIService::parse(AsyncWebServerRequest * request, JsonObject & input) {
|
void WebAPIService::parse(AsyncWebServerRequest * request, JsonObject & input) {
|
||||||
auto method = request->method();
|
// check if the user has admin privileges (token is included and authorized)
|
||||||
|
|
||||||
// see if the user has admin privelegs
|
|
||||||
bool is_admin;
|
bool is_admin;
|
||||||
EMSESP::webSettingsService.read([&](WebSettings & settings) {
|
EMSESP::webSettingsService.read([&](WebSettings & settings) {
|
||||||
Authentication authentication = _securityManager->authenticateRequest(request);
|
Authentication authentication = _securityManager->authenticateRequest(request);
|
||||||
@@ -84,9 +82,8 @@ void WebAPIService::parse(AsyncWebServerRequest * request, JsonObject & input) {
|
|||||||
}
|
}
|
||||||
emsesp::EMSESP::logger().err(error);
|
emsesp::EMSESP::logger().err(error);
|
||||||
} else {
|
} else {
|
||||||
emsesp::EMSESP::logger().info(F("Command called"));
|
emsesp::EMSESP::logger().debug(F("API command called successfully"));
|
||||||
// if there was not json output from the call, default to the message 'OK'.
|
// if there was no json output from the call, default to the output message 'OK'.
|
||||||
// this will be used for example when calling endpoints e.g. /api/thermostat/temp
|
|
||||||
if (!output.size()) {
|
if (!output.size()) {
|
||||||
output["message"] = "OK";
|
output["message"] = "OK";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user