Skip to content

Commit

Permalink
Merge tag 'mega-20231013' into mega_vurk_dmr
Browse files Browse the repository at this point in the history
Release mega-20231013

Changes in mega-20231013 (since mega-20230930):

Fabio Ancona (1):
      Fix SI7021/HTU21D DOC links

TD-er (3):
      [P039_Thermosensors] Fix check for valid value
      [Controller Settings] Fix inverted Send LWT and Will Retain
      automatically updated release notes for mega-20231013

Ton Huisman (5):
      [Networking] Log string and formatting improvements for size
      [Networking] Fix typo in string argument for strformat
      [P047] Update address-change documentation
      [P131] Optimization for build size
      [UI] Show Controller-state on Device page

dobry kod (3):
      [GPIO] Fix taking wrong branch in GPIO_Monitor10xSec when MCP/PCF plugin is disabled
      [GPIO] Fix response to Status command
      [GPIO] Fix mode reported in response to Status command
  • Loading branch information
erstec committed Feb 20, 2024
2 parents 251168c + f74a544 commit 5ec6af1
Show file tree
Hide file tree
Showing 15 changed files with 93 additions and 103 deletions.
26 changes: 26 additions & 0 deletions dist/Release_notes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
-------------------------------------------------
Changes in release mega-20231013 (since mega-20230930)
-------------------------------------------------

Release date: Fri Oct 13 06:01:32 PM CEST 2023

Fabio Ancona (1):
Fix SI7021/HTU21D DOC links

TD-er (2):
[P039_Thermosensors] Fix check for valid value
[Controller Settings] Fix inverted Send LWT and Will Retain

Ton Huisman (5):
[Networking] Log string and formatting improvements for size
[Networking] Fix typo in string argument for strformat
[P047] Update address-change documentation
[P131] Optimization for build size
[UI] Show Controller-state on Device page

dobry kod (3):
[GPIO] Fix taking wrong branch in GPIO_Monitor10xSec when MCP/PCF plugin is disabled
[GPIO] Fix response to Status command
[GPIO] Fix mode reported in response to Status command


-------------------------------------------------
Changes in release mega-20230930 (since mega-20230822)
-------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions docs/source/Plugin/P047.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ The available settings here depend on the build used. At least the **Force Slow

* **I2C Address (Hex)**: The address the device is using. The default I2C address is prefilled, and can be configured to use a different address, see below. As this can be any valid I2C address in range: 0x01..0x7F, it has to be typed here, using a hexadecimal value.

.. note:: If the device doesn't stay enabled after setting the Enabled checkbox, then possibly the address of the sensor is changed from the default. The I2C Scan on the Tools page can be used to detect what I2C device addresses are in use (disconnect other I2C devices to avoid confusion). Possibly, another device-model is listed for this sensor, but that is caused by the feature that it can have any address set that's in the I2C allowed range of 0x00 to 0x7F.

Device Settings
^^^^^^^^^^^^^^^^

Expand All @@ -81,6 +83,8 @@ When selecting the BeFlE sensor, only these **Device Settings** will be availabl

* **Change I2C Addr. to (Hex)**: The new address to be used by the sensor. The change will be applied the next time the task is enabled. The **I2C Address (Hex)** field, above, will be updated with the new value. After the change is applied, **the tasks Settings have to be saved once more to save the new address** as the address to use.

.. note:: The newly set address is permanently stored in the sensor, and can be changed again at a later time if desired.

Data Acquisition
^^^^^^^^^^^^^^^^

Expand Down
4 changes: 2 additions & 2 deletions docs/source/Plugin/_plugin_substitutions_p01x.repl
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
.. |P014_typename| replace:: :cyan:`Environment - SI7021/HTU21D`
.. |P014_porttype| replace:: `.`
.. |P014_status| replace:: :green:`NORMAL` :yellow:`CLIMATE`
.. |P014_github| replace:: P014_SI7021.ino
.. _P014_github: https://github.com/letscontrolit/ESPEasy/blob/mega/src/_P014_SI7021.ino
.. |P014_github| replace:: P014_SI70xx.ino
.. _P014_github: https://github.com/letscontrolit/ESPEasy/blob/mega/src/_P014_SI70xx.ino
.. |P014_usedby| replace:: `.`
.. |P014_shortinfo| replace:: `.`
.. |P014_maintainer| replace:: `.`
Expand Down
2 changes: 1 addition & 1 deletion src/_P039_Thermosensors.ino
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ boolean Plugin_039(uint8_t function, struct EventStruct *event, String& string)
break;
}

if (!isValidFloat(Plugin_039_Celsius))
if (isValidFloat(Plugin_039_Celsius))
{
UserVar[event->BaseVarIndex] = Plugin_039_Celsius;

Expand Down
3 changes: 3 additions & 0 deletions src/_P131_NeoPixelMatrix.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// #######################################################################################################

/** Changelog:
* 2023-10-03 tonhuisman: Optimizate alignment of settings struct, exclude some logging if BUILD_NO_DEBUG is defined
* 2023-02-27 tonhuisman: Implement support for getting config values, see AdafruitGFX_Helper.h changelog for details
* 2022-07-30 tonhuisman: Add commands to set scroll-options (settext, setscroll, setstep, setspeed, setempty, setright)
* Fix issue that on startup the display wasn't cleared (unit reset should turn off the display)
Expand Down Expand Up @@ -385,8 +386,10 @@ boolean Plugin_131(uint8_t function, struct EventStruct *event, String& string)
P131_data_struct *P131_data = static_cast<P131_data_struct *>(getPluginTaskData(event->TaskIndex));

success = (nullptr != P131_data) && P131_data->plugin_init(event); // Start the display
# ifndef BUILD_NO_DEBUG
} else {
addLog(LOG_LEVEL_ERROR, F("NEOMATRIX: No GPIO pin configured, init cancelled."));
# endif // ifndef BUILD_NO_DEBUG
}

break;
Expand Down
9 changes: 6 additions & 3 deletions src/src/Commands/GPIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ const __FlashStringHelper * Command_GPIO_Status(struct EventStruct *event, const
{
bool sendStatusFlag;
pluginID_t pluginID;
int8_t value = -1;

switch (tolower(parseString(Line, 2).charAt(0)))
{
Expand All @@ -298,13 +299,15 @@ const __FlashStringHelper * Command_GPIO_Status(struct EventStruct *event, const
#ifdef USES_P009
case 'm': // mcp
pluginID = PLUGIN_MCP;
sendStatusFlag = GPIO_MCP_Read(event->Par2) == -1;
value = GPIO_MCP_Read(event->Par2);
sendStatusFlag = value == -1;
break;
#endif
#ifdef USES_P019
case 'p': // pcf
pluginID = PLUGIN_PCF;
sendStatusFlag = GPIO_PCF_Read(event->Par2) == -1;
value = GPIO_PCF_Read(event->Par2);
sendStatusFlag = value == -1;
break;
#endif
default:
Expand All @@ -318,7 +321,7 @@ const __FlashStringHelper * Command_GPIO_Status(struct EventStruct *event, const
}
const uint32_t key = createKey(pluginID, event->Par2); // WARNING: 'status' uses Par2 instead of Par1
String dummy;
SendStatusOnlyIfNeeded(event, sendStatusFlag, key, dummy, 0);
SendStatusOnlyIfNeeded(event, sendStatusFlag, key, dummy, value);
return return_command_success_flashstr();
}

Expand Down
12 changes: 6 additions & 6 deletions src/src/DataStructs/ControllerSettingsStruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ struct ControllerSettingsStruct
bool mqtt_cleanSession() const { return VariousBits1.mqtt_cleanSession; }
void mqtt_cleanSession(bool value) { VariousBits1.mqtt_cleanSession = value; }

bool mqtt_sendLWT() const { return VariousBits1.mqtt_sendLWT; }
void mqtt_sendLWT(bool value) { VariousBits1.mqtt_sendLWT = value; }
bool mqtt_sendLWT() const { return !VariousBits1.mqtt_not_sendLWT; }
void mqtt_sendLWT(bool value) { VariousBits1.mqtt_not_sendLWT = !value; }

bool mqtt_willRetain() const { return VariousBits1.mqtt_willRetain; }
void mqtt_willRetain(bool value) { VariousBits1.mqtt_willRetain = value; }
bool mqtt_willRetain() const { return !VariousBits1.mqtt_not_willRetain; }
void mqtt_willRetain(bool value) { VariousBits1.mqtt_not_willRetain = !value; }

bool mqtt_uniqueMQTTclientIdReconnect() const { return VariousBits1.mqtt_uniqueMQTTclientIdReconnect; }
void mqtt_uniqueMQTTclientIdReconnect(bool value) { VariousBits1.mqtt_uniqueMQTTclientIdReconnect = value; }
Expand Down Expand Up @@ -176,8 +176,8 @@ struct ControllerSettingsStruct
struct {
uint32_t unused_00 : 1; // Bit 00
uint32_t mqtt_cleanSession : 1; // Bit 01
uint32_t mqtt_sendLWT : 1; // Bit 02
uint32_t mqtt_willRetain : 1; // Bit 03
uint32_t mqtt_not_sendLWT : 1; // Bit 02, !value, default enabled
uint32_t mqtt_not_willRetain : 1; // Bit 03, !value, default enabled
uint32_t mqtt_uniqueMQTTclientIdReconnect : 1; // Bit 04
uint32_t mqtt_retainFlag : 1; // Bit 05
uint32_t useExtendedCredentials : 1; // Bit 06
Expand Down
8 changes: 4 additions & 4 deletions src/src/ESPEasyCore/ESPEasyGPIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,18 +426,18 @@ void GPIO_Monitor10xSec()
currentState = GPIO_Read_Switch_State(gpioPort, it->second.mode);
eventString = F("GPIO");
break;
case PLUGIN_MCP_INT:
#ifdef USES_P009
case PLUGIN_MCP_INT:
currentState = GPIO_MCP_Read(gpioPort);
eventString = F("MCP");
#endif
break;
case PLUGIN_PCF_INT:
#endif
#ifdef USES_P019
case PLUGIN_PCF_INT:
currentState = GPIO_PCF_Read(gpioPort);
eventString = F("PCF");
#endif
break;
#endif
default:
caseFound=false;
break;
Expand Down
5 changes: 1 addition & 4 deletions src/src/Globals/CPlugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,7 @@ String getCPluginNameFromCPluginID(cpluginID_t cpluginID) {
protocolIndex_t protocolIndex = getProtocolIndex_from_CPluginID_(cpluginID);

if (!validProtocolIndex(protocolIndex)) {
String name = F("CPlugin ");
name += String(static_cast<int>(cpluginID));
name += F(" not included in build");
return name;
return strformat(F("CPlugin %d not included in build"), cpluginID);
}
return getCPluginNameFromProtocolIndex(protocolIndex);
}
17 changes: 5 additions & 12 deletions src/src/Globals/Plugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,7 @@ String getPluginNameFromPluginID(pluginID_t pluginID) {
deviceIndex_t deviceIndex = getDeviceIndex(pluginID);

if (!validDeviceIndex(deviceIndex)) {
String name = F("Plugin ");
name += String(pluginID.value);
name += F(" not included in build");
return name;
return strformat(F("Plugin %d not included in build"), pluginID.value);
}
return getPluginNameFromDeviceIndex(deviceIndex);
}
Expand Down Expand Up @@ -654,14 +651,10 @@ bool PluginCall(uint8_t Function, struct EventStruct *event, String& str)
clearPluginTaskData(taskIndex); // Make sure any task data is actually cleared.
if (PluginCallForTask(taskIndex, PLUGIN_INIT, &TempEvent, str, event) &&
loglevelActiveFor(LOG_LEVEL_INFO)) {
String log;
log.reserve(80);
log += concat(F("INIT : Started Priority task "), static_cast<int>(taskIndex + 1));
log += F(", [");
log += getTaskDeviceName(taskIndex);
log += F("] ");
log += getPluginNameFromDeviceIndex(getDeviceIndex_from_TaskIndex(taskIndex));
addLogMove(LOG_LEVEL_INFO, log);
addLogMove(LOG_LEVEL_INFO, strformat(F("INIT : Started Priority task %d, [%s] %s"),
taskIndex + 1,
getTaskDeviceName(taskIndex).c_str(),
getPluginNameFromDeviceIndex(getDeviceIndex_from_TaskIndex(taskIndex)).c_str()));
}
}
}
Expand Down

0 comments on commit 5ec6af1

Please sign in to comment.