Skip to content

Commit

Permalink
Merge pull request letscontrolit#5116 from tonhuisman/feature/DeviceS…
Browse files Browse the repository at this point in the history
…truct-add-pin1-3-gpio-direction

[DeviceStruct] Add PinDirection flag for PIN1..PIN3
  • Loading branch information
TD-er committed Sep 28, 2024
2 parents 789ade8 + 86a54cb commit 8afead7
Show file tree
Hide file tree
Showing 23 changed files with 916 additions and 876 deletions.
25 changes: 12 additions & 13 deletions src/_P004_Dallas.ino
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,18 @@ boolean Plugin_004(uint8_t function, struct EventStruct *event, String& string)
{
case PLUGIN_DEVICE_ADD:
{
Device[++deviceCount].Number = PLUGIN_ID_004;
Device[deviceCount].Type = DEVICE_TYPE_DUAL;
Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_SINGLE;
Device[deviceCount].Ports = 0;
Device[deviceCount].PullUpOption = false;
Device[deviceCount].InverseLogicOption = false;
Device[deviceCount].FormulaOption = true;
Device[deviceCount].ValueCount = 1;
Device[deviceCount].SendDataOption = true;
Device[deviceCount].TimerOption = true;
Device[deviceCount].GlobalSyncOption = true;
Device[deviceCount].OutputDataType = Output_Data_type_t::Simple;
Device[deviceCount].PluginStats = true;
Device[++deviceCount].Number = PLUGIN_ID_004;
Device[deviceCount].Type = DEVICE_TYPE_DUAL;
Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_SINGLE;
Device[deviceCount].Ports = 0;
Device[deviceCount].FormulaOption = true;
Device[deviceCount].ValueCount = 1;
Device[deviceCount].SendDataOption = true;
Device[deviceCount].TimerOption = true;
Device[deviceCount].GlobalSyncOption = true;
Device[deviceCount].OutputDataType = Output_Data_type_t::Simple;
Device[deviceCount].PluginStats = true;
Device[deviceCount].Pin2Direction = gpio_direction::gpio_output;
break;
}

Expand Down
1 change: 1 addition & 0 deletions src/_P013_HCSR04.ino
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ boolean Plugin_013(uint8_t function, struct EventStruct *even
Device[deviceCount].TimerOptional = true;
Device[deviceCount].GlobalSyncOption = true;
Device[deviceCount].PluginStats = true;
Device[deviceCount].Pin1Direction = gpio_direction::gpio_output;

break;
}
Expand Down
3 changes: 1 addition & 2 deletions src/_P018_Dust.ino
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ boolean Plugin_018(uint8_t function, struct EventStruct *event, String& string)
Device[deviceCount].Type = DEVICE_TYPE_SINGLE;
Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_SINGLE;
Device[deviceCount].Ports = 0;
Device[deviceCount].PullUpOption = false;
Device[deviceCount].InverseLogicOption = false;
Device[deviceCount].FormulaOption = true;
Device[deviceCount].ValueCount = 1;
Device[deviceCount].SendDataOption = true;
Device[deviceCount].TimerOption = true;
Device[deviceCount].GlobalSyncOption = true;
Device[deviceCount].PluginStats = true;
Device[deviceCount].Pin1Direction = gpio_direction::gpio_output;
break;
}

Expand Down
21 changes: 11 additions & 10 deletions src/_P021_Level.ino
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,13 @@ boolean Plugin_021(uint8_t function, struct EventStruct *event, String& string)
{
case PLUGIN_DEVICE_ADD:
{
Device[++deviceCount].Number = PLUGIN_ID_021;
Device[deviceCount].Type = DEVICE_TYPE_SINGLE;
Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_SWITCH;
Device[deviceCount].Ports = 0;
Device[deviceCount].PullUpOption = false;
Device[deviceCount].InverseLogicOption = false;
Device[deviceCount].FormulaOption = false;
Device[deviceCount].ValueCount = 1;
Device[deviceCount].SendDataOption = true;
Device[deviceCount].TimerOption = false;
Device[++deviceCount].Number = PLUGIN_ID_021;
Device[deviceCount].Type = DEVICE_TYPE_SINGLE;
Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_SWITCH;
Device[deviceCount].Ports = 0;
Device[deviceCount].ValueCount = 1;
Device[deviceCount].SendDataOption = true;
Device[deviceCount].Pin1Direction = gpio_direction::gpio_output;
break;
}

Expand Down Expand Up @@ -100,14 +97,18 @@ boolean Plugin_021(uint8_t function, struct EventStruct *event, String& string)
addFormCheckBox(F("Save 'Set Level'/'Hysteresis' after change via <pre>config</pre> command"),
F("psave_always"),
P021_DONT_ALWAYS_SAVE == 0);

// # ifndef BUILD_NO_DEBUG
addFormNote(F("Saving settings too often can wear out the flash chip on your ESP!"));

// # endif // ifndef BUILD_NO_DEBUG

addFormNumericBox(F("Auto-save interval"), F("pautosave"), P021_AUTOSAVE_TIMER / 60, 0, 1440); // Present in minutes
addUnit(F("minutes"));

// # ifndef BUILD_NO_DEBUG
addFormNote(F("Interval to check if settings are changed via <pre>config</pre> command and saves that. Max. 24h, 0 = Off"));

// # endif // ifndef BUILD_NO_DEBUG

success = true;
Expand Down
5 changes: 1 addition & 4 deletions src/_P029_Output.ino
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ boolean Plugin_029(uint8_t function, struct EventStruct *event, String& string)
Device[deviceCount].Type = DEVICE_TYPE_SINGLE;
Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_SWITCH;
Device[deviceCount].Ports = 0;
Device[deviceCount].PullUpOption = false;
Device[deviceCount].InverseLogicOption = false;
Device[deviceCount].FormulaOption = false;
Device[deviceCount].ValueCount = 1;
Device[deviceCount].SendDataOption = false;
Device[deviceCount].Pin1Direction = gpio_direction::gpio_output;
break;
}

Expand Down
23 changes: 11 additions & 12 deletions src/_P031_SHT1X.ino
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@ boolean Plugin_031(uint8_t function, struct EventStruct *event, String& string)
{
case PLUGIN_DEVICE_ADD:
{
Device[++deviceCount].Number = PLUGIN_ID_031;
Device[deviceCount].Type = DEVICE_TYPE_DUAL;
Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_TEMP_HUM;
Device[deviceCount].Ports = 0;
Device[deviceCount].PullUpOption = true;
Device[deviceCount].InverseLogicOption = false;
Device[deviceCount].FormulaOption = true;
Device[deviceCount].ValueCount = 2;
Device[deviceCount].SendDataOption = true;
Device[deviceCount].TimerOption = true;
Device[deviceCount].GlobalSyncOption = true;
Device[deviceCount].PluginStats = true;
Device[++deviceCount].Number = PLUGIN_ID_031;
Device[deviceCount].Type = DEVICE_TYPE_DUAL;
Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_TEMP_HUM;
Device[deviceCount].Ports = 0;
Device[deviceCount].PullUpOption = true;
Device[deviceCount].FormulaOption = true;
Device[deviceCount].ValueCount = 2;
Device[deviceCount].SendDataOption = true;
Device[deviceCount].TimerOption = true;
Device[deviceCount].PluginStats = true;
Device[deviceCount].Pin2Direction = gpio_direction::gpio_output;
break;
}

Expand Down
1 change: 1 addition & 0 deletions src/_P035_IRTX.ino
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ boolean Plugin_035(uint8_t function, struct EventStruct *event, String& string)
Device[++deviceCount].Number = PLUGIN_ID_035;
Device[deviceCount].Type = DEVICE_TYPE_SINGLE;
Device[deviceCount].SendDataOption = false;
Device[deviceCount].Pin1Direction = gpio_direction::gpio_output;
break;
}

Expand Down
7 changes: 4 additions & 3 deletions src/_P038_NeoPixel.ino
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ boolean Plugin_038(uint8_t function, struct EventStruct *event, String& string)
{
case PLUGIN_DEVICE_ADD:
{
Device[++deviceCount].Number = PLUGIN_ID_038;
Device[deviceCount].Type = DEVICE_TYPE_SINGLE;
Device[deviceCount].TimerOption = false;
Device[++deviceCount].Number = PLUGIN_ID_038;
Device[deviceCount].Type = DEVICE_TYPE_SINGLE;
Device[deviceCount].TimerOption = false;
Device[deviceCount].Pin1Direction = gpio_direction::gpio_output;
break;
}

Expand Down
15 changes: 6 additions & 9 deletions src/_P041_NeoClock.ino
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,12 @@ boolean Plugin_041(uint8_t function, struct EventStruct *event, String& string)
{
case PLUGIN_DEVICE_ADD:
{
Device[++deviceCount].Number = PLUGIN_ID_041;
Device[deviceCount].Type = DEVICE_TYPE_SINGLE;
Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_NONE;
Device[deviceCount].Ports = 0;
Device[deviceCount].PullUpOption = false;
Device[deviceCount].InverseLogicOption = false;
Device[deviceCount].FormulaOption = false;
Device[deviceCount].ValueCount = 0;
Device[deviceCount].SendDataOption = false;
Device[++deviceCount].Number = PLUGIN_ID_041;
Device[deviceCount].Type = DEVICE_TYPE_SINGLE;
Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_NONE;
Device[deviceCount].Ports = 0;
Device[deviceCount].ValueCount = 0;
Device[deviceCount].Pin1Direction = gpio_direction::gpio_output;
break;
}

Expand Down
19 changes: 8 additions & 11 deletions src/_P042_Candle.ino
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,14 @@ boolean Plugin_042(uint8_t function, struct EventStruct *event, String& string)
{
case PLUGIN_DEVICE_ADD:
{
Device[++deviceCount].Number = PLUGIN_ID_042;
Device[deviceCount].Type = DEVICE_TYPE_SINGLE;
Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_TRIPLE;
Device[deviceCount].Ports = 0;
Device[deviceCount].PullUpOption = false;
Device[deviceCount].InverseLogicOption = false;
Device[deviceCount].FormulaOption = false;
Device[deviceCount].ValueCount = 3;
Device[deviceCount].SendDataOption = true;
Device[deviceCount].TimerOption = true;
Device[deviceCount].GlobalSyncOption = false;
Device[++deviceCount].Number = PLUGIN_ID_042;
Device[deviceCount].Type = DEVICE_TYPE_SINGLE;
Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_TRIPLE;
Device[deviceCount].Ports = 0;
Device[deviceCount].ValueCount = 3;
Device[deviceCount].SendDataOption = true;
Device[deviceCount].TimerOption = true;
Device[deviceCount].Pin1Direction = gpio_direction::gpio_output;
break;
}

Expand Down
18 changes: 8 additions & 10 deletions src/_P043_ClkOutput.ino
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,14 @@ boolean Plugin_043(uint8_t function, struct EventStruct *event, String& string)
{
case PLUGIN_DEVICE_ADD:
{
Device[++deviceCount].Number = PLUGIN_ID_043;
Device[deviceCount].Type = DEVICE_TYPE_SINGLE;
Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_SWITCH;
Device[deviceCount].Ports = 0;
Device[deviceCount].PullUpOption = false;
Device[deviceCount].InverseLogicOption = false;
Device[deviceCount].FormulaOption = false;
Device[deviceCount].ValueCount = 2;
Device[deviceCount].SendDataOption = true;
Device[deviceCount].OutputDataType = Output_Data_type_t::Simple;
Device[++deviceCount].Number = PLUGIN_ID_043;
Device[deviceCount].Type = DEVICE_TYPE_SINGLE;
Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_SWITCH;
Device[deviceCount].Ports = 0;
Device[deviceCount].ValueCount = 2;
Device[deviceCount].SendDataOption = true;
Device[deviceCount].OutputDataType = Output_Data_type_t::Simple;
Device[deviceCount].Pin1Direction = gpio_direction::gpio_output;
break;
}

Expand Down
Loading

0 comments on commit 8afead7

Please sign in to comment.