minor refactor

This commit is contained in:
proddy
2019-04-05 18:14:16 +02:00
parent 2fa258ccb0
commit 53a4106dff
3 changed files with 2 additions and 42 deletions

View File

@@ -828,9 +828,9 @@ void _showerColdShotStart() {
// callback for loading/saving settings to the file system (SPIFFS) // callback for loading/saving settings to the file system (SPIFFS)
bool FSCallback(MYESP_FSACTION action, const JsonObject json) { bool FSCallback(MYESP_FSACTION action, const JsonObject json) {
bool recreate_config = true;
if (action == MYESP_FSACTION_LOAD) { if (action == MYESP_FSACTION_LOAD) {
bool recreate_config = true;
// led // led
EMSESP_Status.led = json["led"]; EMSESP_Status.led = json["led"];

View File

@@ -1456,45 +1456,6 @@ void ems_discoverModels() {
} }
} }
/*
* Given a thermostat model ID go and fetch its characteristics
*/
void _ems_setThermostatModel(uint8_t thermostat_modelid) {
bool found = false;
uint8_t i = 0;
const _Thermostat_Type * thermostat_type;
while (i < _Thermostat_Types_max) {
thermostat_type = &Thermostat_Types[i];
if (thermostat_type->model_id == thermostat_modelid) {
found = true; // we have a matching product id
break;
}
i++;
}
if (!found) {
if (EMS_Sys_Status.emsLogging >= EMS_SYS_LOGGING_BASIC) {
myDebug("Unknown thermostat model specified. Trying a scan...");
}
ems_scanDevices(); // auto-discover it
return;
}
// set the thermostat
if (EMS_Sys_Status.emsLogging >= EMS_SYS_LOGGING_BASIC) {
myDebug("Setting Thermostat. Model %s with TypeID 0x%02X, ProductID %d",
thermostat_type->model_string,
thermostat_type->type_id,
thermostat_type->product_id);
}
// set its capabilities
EMS_Thermostat.model_id = thermostat_type->model_id;
EMS_Thermostat.type_id = thermostat_type->type_id;
EMS_Thermostat.read_supported = thermostat_type->read_supported;
EMS_Thermostat.write_supported = thermostat_type->write_supported;
}
/** /**
* Print the Tx queue - for debugging * Print the Tx queue - for debugging
*/ */

View File

@@ -315,7 +315,6 @@ void _debugPrintPackage(const char * prefix, _EMS_RxTelegram * EMS_RxTelegram
void _ems_clearTxData(); void _ems_clearTxData();
int _ems_findBoilerModel(uint8_t model_id); int _ems_findBoilerModel(uint8_t model_id);
bool _ems_setModel(uint8_t model_id); bool _ems_setModel(uint8_t model_id);
void _ems_setThermostatModel(uint8_t thermostat_modelid);
void _removeTxQueue(); void _removeTxQueue();
void _ems_readTelegram(uint8_t * telegram, uint8_t length); void _ems_readTelegram(uint8_t * telegram, uint8_t length);