mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
autoformatting
This commit is contained in:
@@ -854,8 +854,24 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
|||||||
if (model() != EMS_DEVICE_FLAG_HEATPUMP) {
|
if (model() != EMS_DEVICE_FLAG_HEATPUMP) {
|
||||||
register_telegram_type(0x04, "UBAFactory", true, MAKE_PF_CB(process_UBAFactory));
|
register_telegram_type(0x04, "UBAFactory", true, MAKE_PF_CB(process_UBAFactory));
|
||||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &nomPower_, DeviceValueType::UINT, FL_(nomPower), DeviceValueUOM::KW, MAKE_CF_CB(set_nomPower));
|
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &nomPower_, DeviceValueType::UINT, FL_(nomPower), DeviceValueUOM::KW, MAKE_CF_CB(set_nomPower));
|
||||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &nrgHeat_, DeviceValueType::ULONG, DeviceValueNumOp::DV_NUMOP_DIV100, FL_(nrgHeat), DeviceValueUOM::KWH, MAKE_CF_CB(set_nrgHeat), 0, 10000000UL);
|
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &nrgWw_, DeviceValueType::ULONG, DeviceValueNumOp::DV_NUMOP_DIV100, FL_(nrgWw), DeviceValueUOM::KWH, MAKE_CF_CB(set_nrgWw), 0, 10000000UL);
|
&nrgHeat_,
|
||||||
|
DeviceValueType::ULONG,
|
||||||
|
DeviceValueNumOp::DV_NUMOP_DIV100,
|
||||||
|
FL_(nrgHeat),
|
||||||
|
DeviceValueUOM::KWH,
|
||||||
|
MAKE_CF_CB(set_nrgHeat),
|
||||||
|
0,
|
||||||
|
10000000UL);
|
||||||
|
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||||
|
&nrgWw_,
|
||||||
|
DeviceValueType::ULONG,
|
||||||
|
DeviceValueNumOp::DV_NUMOP_DIV100,
|
||||||
|
FL_(nrgWw),
|
||||||
|
DeviceValueUOM::KWH,
|
||||||
|
MAKE_CF_CB(set_nrgWw),
|
||||||
|
0,
|
||||||
|
10000000UL);
|
||||||
|
|
||||||
nrgHeatF_ = EMSESP::nvs_.getDouble(FL_(nrgHeat)[0], 0);
|
nrgHeatF_ = EMSESP::nvs_.getDouble(FL_(nrgHeat)[0], 0);
|
||||||
nrgWwF_ = EMSESP::nvs_.getDouble(FL_(nrgWw)[0], 0);
|
nrgWwF_ = EMSESP::nvs_.getDouble(FL_(nrgWw)[0], 0);
|
||||||
|
|||||||
@@ -481,7 +481,6 @@ class Boiler : public EMSdevice {
|
|||||||
bool set_nrgHeat(const char * value, const int8_t id);
|
bool set_nrgHeat(const char * value, const int8_t id);
|
||||||
bool set_nrgWw(const char * value, const int8_t id);
|
bool set_nrgWw(const char * value, const int8_t id);
|
||||||
bool set_nomPower(const char * value, const int8_t id);
|
bool set_nomPower(const char * value, const int8_t id);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace emsesp
|
} // namespace emsesp
|
||||||
|
|||||||
@@ -1671,7 +1671,7 @@ bool EMSdevice::generate_values(JsonObject & output, const uint8_t tag_filter, c
|
|||||||
if (v < dv.min) {
|
if (v < dv.min) {
|
||||||
dv.min = v;
|
dv.min = v;
|
||||||
dv.remove_state(DeviceValueState::DV_HA_CONFIG_CREATED);
|
dv.remove_state(DeviceValueState::DV_HA_CONFIG_CREATED);
|
||||||
} else if (v > dv.max) {
|
} else if ((uint32_t)v > dv.max) {
|
||||||
dv.max = v;
|
dv.max = v;
|
||||||
dv.remove_state(DeviceValueState::DV_HA_CONFIG_CREATED);
|
dv.remove_state(DeviceValueState::DV_HA_CONFIG_CREATED);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ bool DeviceValue::get_custom_min(int16_t & val) {
|
|||||||
bool has_min = (min_pos != std::string::npos);
|
bool has_min = (min_pos != std::string::npos);
|
||||||
uint8_t fahrenheit = !EMSESP::system_.fahrenheit() ? 0 : (uom == DeviceValueUOM::DEGREES) ? 2 : (uom == DeviceValueUOM::DEGREES_R) ? 1 : 0;
|
uint8_t fahrenheit = !EMSESP::system_.fahrenheit() ? 0 : (uom == DeviceValueUOM::DEGREES) ? 2 : (uom == DeviceValueUOM::DEGREES_R) ? 1 : 0;
|
||||||
if (has_min) {
|
if (has_min) {
|
||||||
int v = Helpers::atoint(custom_fullname.substr(min_pos + 1).c_str());
|
uint32_t v = Helpers::atoint(custom_fullname.substr(min_pos + 1).c_str());
|
||||||
if (fahrenheit) {
|
if (fahrenheit) {
|
||||||
v = (v - (32 * (fahrenheit - 1))) / 1.8; // reset to °C
|
v = (v - (32 * (fahrenheit - 1))) / 1.8; // reset to °C
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user