mirror of
https://github.com/anklimov/lighthub
synced 2025-12-06 19:59:50 +03:00
Remove wrong space- MQTT payload, more memory ctrl
This commit is contained in:
@@ -887,6 +887,11 @@ int Item::Ctrl(itemCmd cmd, char* subItem, bool allowRecursion)
|
|||||||
}
|
}
|
||||||
if (itemType==CH_GROUP)
|
if (itemType==CH_GROUP)
|
||||||
{
|
{
|
||||||
|
if (fr<350)
|
||||||
|
{
|
||||||
|
errorSerial<<F("Not enough memory for group operation")<<endl;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
if (allowRecursion && itemArg->type == aJson_Array && operation)
|
if (allowRecursion && itemArg->type == aJson_Array && operation)
|
||||||
{
|
{
|
||||||
digGroup(itemArg,&cmd,subItem);
|
digGroup(itemArg,&cmd,subItem);
|
||||||
|
|||||||
@@ -1076,13 +1076,18 @@ char * itemCmd::toString(char * Buffer, int bufLen, int sendFlags, bool scale100
|
|||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
strncpy_P(Buffer, commands_P[cmd.cmdCode], bufLen);
|
strncpy_P(Buffer, commands_P[cmd.cmdCode], bufLen);
|
||||||
strncat(Buffer, " ", bufLen);
|
//strncat(Buffer, " ", bufLen);
|
||||||
len=strlen(Buffer);
|
len=strlen(Buffer);
|
||||||
argPtr+=len;
|
argPtr+=len;
|
||||||
bufLen-=len;
|
bufLen-=len;
|
||||||
bufLen--;
|
bufLen--;
|
||||||
}
|
}
|
||||||
if (sendFlags & SEND_PARAMETERS)
|
if (isValue() && (sendFlags & SEND_PARAMETERS))
|
||||||
|
{
|
||||||
|
strncat(Buffer, " ", bufLen);
|
||||||
|
bufLen--;
|
||||||
|
argPtr++;
|
||||||
|
|
||||||
switch (cmd.itemArgType)
|
switch (cmd.itemArgType)
|
||||||
{ short colorTemp;
|
{ short colorTemp;
|
||||||
|
|
||||||
@@ -1142,6 +1147,7 @@ char * itemCmd::toString(char * Buffer, int bufLen, int sendFlags, bool scale100
|
|||||||
default:
|
default:
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return Buffer;
|
return Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user