Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/src/Helpers/Hardware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,9 +952,17 @@ void setTaskDevice_to_TaskIndex(pluginID_t taskdevicenumber, taskIndex_t taskInd
PluginCall(PLUGIN_SET_DEFAULTS, &TempEvent, dummy);
PluginCall(PLUGIN_GET_DEVICEVALUENAMES, &TempEvent, dummy); // the plugin should populate ExtraTaskSettings with its default values.

const deviceIndex_t DeviceIndex = getDeviceIndex_from_TaskIndex(taskIndex);

if (!Device[DeviceIndex].TimerOptional) { // Set default delay, unless it's optional...
Settings.TaskDeviceTimer[taskIndex] = Settings.Delay;
}
else {
Settings.TaskDeviceTimer[taskIndex] = 0;
}

#if FEATURE_MQTT_DISCOVER && FEATURE_CUSTOM_TASKVAR_VTYPE && FEATURE_TASKVALUE_UNIT_OF_MEASURE
// Fill in standard Unit of measurement and Value Type, if possible
const deviceIndex_t DeviceIndex = getDeviceIndex_from_TaskIndex(taskIndex);
std::vector<DiscoveryItem> discoveryItems;
MQTT_DiscoveryGetDeviceVType(taskIndex, discoveryItems, getValueCountForTask(taskIndex), dummy);

Expand Down