You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When looking at the diffs of code between april and august build, it became clear that at least the implementation of P001 has changed regarding send bootstate.
Before, the uservar values were set after toggling the state and savePortStatus
This is referring to how the code was in April build:
boolGPIO_plugin_helper_data_t::init(
structEventStruct *event,
int8_t pinState,
uint8_t pinModeValue)
{
// Read current status or create empty if it does not exist
portStatusStruct newStatus = globalMapPortStatus[_portStatus_key];
newStatus.state = pinState;
newStatus.output = newStatus.state; // FIXME TD-er: Is this correct to set output value based on pinState?
newStatus.mode = pinModeValue;
// @giig1967g: if it is in the device list we assume it's an input pin// add this GPIO/port as a taskif (newStatus.task < 3) {
newStatus.task++;
}
// if boot pinState must be send, inverse default pinState// this is done to force the trigger in PLUGIN_TEN_PER_SECONDif (_sendBootState) {
newStatus.state = !newStatus.state;
if (_pluginNumber == PLUGIN_GPIO) {
// FIXME TD-er: This was only done in P001, should this be done for PCF/MCP too?// Or maybe this is wrong to do for internal GPIO?
newStatus.output = !newStatus.output;
}
}
// setPinState(PLUGIN_ID_009, _mcpPin, PIN_MODE_INPUT, switchstate[event->TaskIndex]);savePortStatus(_portStatus_key, newStatus);
// @giig1967g-20181022: set initial UserVar of the switchif ((newStatus.state != -1) && Settings.TaskDevicePin1Inversed[event->TaskIndex]) {
UserVar.setFloat(event->TaskIndex, 0, !newStatus.state);
} else {
UserVar.setFloat(event->TaskIndex, 0, newStatus.state);
}
returntrue;
}
However the current implementation is more like how it was done in P009 and P019.
It is not sure which one is correct, but @thomastech reported some change in behavior which could be worked around by unchecking sendBootState.
The text was updated successfully, but these errors were encountered:
When looking at the diffs of code between april and august build, it became clear that at least the implementation of P001 has changed regarding send bootstate.
Before, the uservar values were set after toggling the state and
savePortStatus
This is referring to how the code was in April build:
However the current implementation is more like how it was done in P009 and P019.
It is not sure which one is correct, but @thomastech reported some change in behavior which could be worked around by unchecking sendBootState.
The text was updated successfully, but these errors were encountered: