diff --git a/src/_Plugin_Helper.cpp b/src/_Plugin_Helper.cpp index e76007857..80982f736 100644 --- a/src/_Plugin_Helper.cpp +++ b/src/_Plugin_Helper.cpp @@ -138,18 +138,6 @@ int getValueCountForTask(taskIndex_t taskIndex) { return TempEvent.Par1; } -Sensor_VType getDeviceVTypeForTask(taskIndex_t taskIndex) { - int dummyIndex; - return getDeviceVTypeForTask(taskIndex, dummyIndex); -} - -Sensor_VType getDeviceVTypeForTask(taskIndex_t taskIndex, int& pconfig_index) { - struct EventStruct TempEvent(taskIndex); - pconfig_index = checkDeviceVTypeForTask(&TempEvent); - return TempEvent.sensorType; -} - - int checkDeviceVTypeForTask(struct EventStruct* event) { if (event->sensorType == Sensor_VType::SENSOR_TYPE_NOT_SET) { if (validTaskIndex(event->TaskIndex)) { diff --git a/src/_Plugin_Helper.h b/src/_Plugin_Helper.h index fce7395fe..06cddbe47 100644 --- a/src/_Plugin_Helper.h +++ b/src/_Plugin_Helper.h @@ -101,9 +101,6 @@ bool pluginOptionalTaskIndexArgumentMatch(taskIndex_t taskIndex, int getValueCountForTask(taskIndex_t taskIndex); -Sensor_VType getDeviceVTypeForTask(taskIndex_t taskIndex); -Sensor_VType getDeviceVTypeForTask(taskIndex_t taskIndex, int& pconfig_index); - // Check if the DeviceVType is set and update if it isn't. // Return pconfig_index int checkDeviceVTypeForTask(struct EventStruct* event); diff --git a/src/src/Helpers/_CPlugin_SensorTypeHelper.cpp b/src/src/Helpers/_CPlugin_SensorTypeHelper.cpp index 1891985dc..d3c797d52 100644 --- a/src/src/Helpers/_CPlugin_SensorTypeHelper.cpp +++ b/src/src/Helpers/_CPlugin_SensorTypeHelper.cpp @@ -110,7 +110,8 @@ void sensorTypeHelper_webformLoad(struct EventStruct *event, byte pconfigIndex, PCONFIG(pconfigIndex) = static_cast(choice); } else if (getValueCountFromSensorType(choice) != getValueCountForTask(event->TaskIndex)) { // Invalid value - choice = getDeviceVTypeForTask(event->TaskIndex); + checkDeviceVTypeForTask(event); + choice = event->sensorType; PCONFIG(pconfigIndex) = static_cast(choice); } addRowLabel(F("Output Data Type"));