Streamlined NVS recall for String values
Avoids need for intermediate variable
This commit is contained in:
parent
9e3f6c8303
commit
c4e88d7df0
|
|
@ -635,9 +635,8 @@ class SpanCharacteristic{
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(!nvs_get_str(homeSpan.charNVS,nvsKey,NULL,&len)){
|
if(!nvs_get_str(homeSpan.charNVS,nvsKey,NULL,&len)){
|
||||||
char c[len];
|
value.STRING = (char *)HS_REALLOC(value.STRING,len);
|
||||||
nvs_get_str(homeSpan.charNVS,nvsKey,c,&len);
|
nvs_get_str(homeSpan.charNVS,nvsKey,value.STRING,&len);
|
||||||
uvSet(value,(const char *)c);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
nvs_set_str(homeSpan.charNVS,nvsKey,value.STRING); // store string data
|
nvs_set_str(homeSpan.charNVS,nvsKey,value.STRING); // store string data
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue