mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 08:49:52 +03:00
auto formatting
This commit is contained in:
18
src/ems.cpp
18
src/ems.cpp
@@ -184,7 +184,7 @@ const _EMS_Type EMS_Types[] = {
|
|||||||
// calculate sizes of arrays at compile
|
// calculate sizes of arrays at compile
|
||||||
uint8_t _EMS_Types_max = ArraySize(EMS_Types); // number of defined types
|
uint8_t _EMS_Types_max = ArraySize(EMS_Types); // number of defined types
|
||||||
uint8_t _Boiler_Types_max = ArraySize(Boiler_Types); // number of boiler models
|
uint8_t _Boiler_Types_max = ArraySize(Boiler_Types); // number of boiler models
|
||||||
uint8_t _Solar_Module_Types_max = ArraySize(SolarModule_Types);// number of solar module types
|
uint8_t _Solar_Module_Types_max = ArraySize(SolarModule_Types); // number of solar module types
|
||||||
uint8_t _Other_Types_max = ArraySize(Other_Types); // number of other ems devices
|
uint8_t _Other_Types_max = ArraySize(Other_Types); // number of other ems devices
|
||||||
uint8_t _Thermostat_Types_max = ArraySize(Thermostat_Types); // number of defined thermostat types
|
uint8_t _Thermostat_Types_max = ArraySize(Thermostat_Types); // number of defined thermostat types
|
||||||
|
|
||||||
@@ -1473,13 +1473,12 @@ void _process_HPMonitor2(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
* Junkers ISM1 Solar Module - type 0x0003 EMS+ for energy readings
|
* Junkers ISM1 Solar Module - type 0x0003 EMS+ for energy readings
|
||||||
*/
|
*/
|
||||||
void _process_ISM1StatusMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
void _process_ISM1StatusMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
||||||
|
|
||||||
if (EMS_RxTelegram->offset == 0) {
|
if (EMS_RxTelegram->offset == 0) {
|
||||||
// e.g. B0 00 FF 00 00 03 32 00 00 00 00 13 00 D6 00 00 00 FB D0 F0
|
// e.g. B0 00 FF 00 00 03 32 00 00 00 00 13 00 D6 00 00 00 FB D0 F0
|
||||||
EMS_SolarModule.collectorTemp = _toShort(4); // Collector Temperature
|
EMS_SolarModule.collectorTemp = _toShort(4); // Collector Temperature
|
||||||
EMS_SolarModule.bottomTemp = _toShort(6); // Temperature Bottom of Solar Boiler
|
EMS_SolarModule.bottomTemp = _toShort(6); // Temperature Bottom of Solar Boiler
|
||||||
EMS_SolarModule.EnergyLastHour = _toShort(2) * 10; // Solar Energy produced in last hour
|
EMS_SolarModule.EnergyLastHour = _toShort(2) * 10; // Solar Energy produced in last hour
|
||||||
EMS_SolarModule.pump = _bitRead(8,0); // Solar pump on (1) or off (0)
|
EMS_SolarModule.pump = _bitRead(8, 0); // Solar pump on (1) or off (0)
|
||||||
// EMS_Other.SM = true;
|
// EMS_Other.SM = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1675,7 +1674,11 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (typeFound) {
|
if (typeFound) {
|
||||||
myDebug_P(PSTR("Solar Module found: %s (DeviceID:0x%02X ProductID:%d Version:%s)"), SolarModule_Types[i].model_string, SolarModule_Types[i].device_id, product_id, version);
|
myDebug_P(PSTR("Solar Module found: %s (DeviceID:0x%02X ProductID:%d Version:%s)"),
|
||||||
|
SolarModule_Types[i].model_string,
|
||||||
|
SolarModule_Types[i].device_id,
|
||||||
|
product_id,
|
||||||
|
version);
|
||||||
|
|
||||||
// add to list
|
// add to list
|
||||||
_addDevice(product_id, SolarModule_Types[i].device_id, version, SolarModule_Types[i].model_string);
|
_addDevice(product_id, SolarModule_Types[i].device_id, version, SolarModule_Types[i].model_string);
|
||||||
@@ -1690,7 +1693,6 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
// fetch Solar Module values
|
// fetch Solar Module values
|
||||||
ems_getSolarModuleValues();
|
ems_getSolarModuleValues();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1719,7 +1721,6 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
EMS_Other.product_id = product_id;
|
EMS_Other.product_id = product_id;
|
||||||
strlcpy(EMS_Other.version, version, sizeof(EMS_Other.version));
|
strlcpy(EMS_Other.version, version, sizeof(EMS_Other.version));
|
||||||
// fetch Solar Module values > not yet implemented
|
// fetch Solar Module values > not yet implemented
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -1871,17 +1872,14 @@ void ems_getBoilerValues() {
|
|||||||
* Get other values from EMS devices
|
* Get other values from EMS devices
|
||||||
*/
|
*/
|
||||||
void ems_getSolarModuleValues() {
|
void ems_getSolarModuleValues() {
|
||||||
|
|
||||||
uint8_t product_id = EMS_SolarModule.product_id;
|
uint8_t product_id = EMS_SolarModule.product_id;
|
||||||
|
|
||||||
if (ems_getSolarModuleEnabled()) {
|
if (ems_getSolarModuleEnabled()) {
|
||||||
if (product_id == EMS_PRODUCTID_SM10) {
|
if (product_id == EMS_PRODUCTID_SM10) {
|
||||||
ems_doReadCommand(EMS_TYPE_SM10Monitor, EMS_ID_SM); // fetch all from SM10Monitor
|
ems_doReadCommand(EMS_TYPE_SM10Monitor, EMS_ID_SM); // fetch all from SM10Monitor
|
||||||
}
|
} else if (product_id == EMS_PRODUCTID_SM100) {
|
||||||
else if (product_id == EMS_PRODUCTID_SM100) {
|
|
||||||
ems_doReadCommand(EMS_TYPE_SM100Monitor, EMS_ID_SM); // fetch all from SM100Monitor
|
ems_doReadCommand(EMS_TYPE_SM100Monitor, EMS_ID_SM); // fetch all from SM100Monitor
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user