mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-28 01:29:07 +03:00
solar heat assistance, rounding custom entities #2763
This commit is contained in:
@@ -417,6 +417,20 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(swapRetTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&heatAssistOn_,
|
||||
DeviceValueType::INT8,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(heatAssistOn),
|
||||
DeviceValueUOM::K,
|
||||
MAKE_CF_CB(set_solarHeatAssistOn));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&heatAssistOff_,
|
||||
DeviceValueType::INT8,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(heatAssistOff),
|
||||
DeviceValueUOM::K,
|
||||
MAKE_CF_CB(set_solarHeatAssistOn));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -540,7 +554,8 @@ void Solar::process_SM100Circuit2Config(std::shared_ptr<const Telegram> telegram
|
||||
|
||||
// type 0x35C Heat assistance
|
||||
void Solar::process_SM100HeatAssist(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, solarHeatAssist_, 0); // is *10
|
||||
has_update(telegram, heatAssistOn_, 0); // is *10
|
||||
has_update(telegram, heatAssistOff_, 1); // is *10
|
||||
}
|
||||
|
||||
// type 0x361 differential control
|
||||
@@ -1103,4 +1118,22 @@ bool Solar::set_diffControl(const char * value, const int8_t id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Solar::set_solarHeatAssistOn(const char * value, const int8_t id) {
|
||||
float t;
|
||||
if (!Helpers::value2float(value, t)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x35C, 0, (uint8_t)(t * 10), 0x35C);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Solar::set_solarHeatAssistOff(const char * value, const int8_t id) {
|
||||
float t;
|
||||
if (!Helpers::value2float(value, t)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x35C, 1, (uint8_t)(t * 10), 0x35C);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
Reference in New Issue
Block a user