mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-25 20:26:41 +00:00
Fix compiler errors for file.open
This commit is contained in:
parent
f72e3f3439
commit
e7fc913dd7
@ -343,7 +343,7 @@ void dispatch_topic_payload(const char* topic, const char* payload, bool update)
|
|||||||
// Parse one line of text and execute the command
|
// Parse one line of text and execute the command
|
||||||
void dispatch_text_line(const char* cmnd)
|
void dispatch_text_line(const char* cmnd)
|
||||||
{
|
{
|
||||||
if (cmnd[0]=='/' && cmnd[1]=='/') return; // comment
|
if(cmnd[0] == '/' && cmnd[1] == '/') return; // comment
|
||||||
|
|
||||||
switch(cmnd[0]) {
|
switch(cmnd[0]) {
|
||||||
case '#':
|
case '#':
|
||||||
@ -1161,7 +1161,8 @@ void dispatch_service(const char*, const char* payload)
|
|||||||
|
|
||||||
void dispatch_exec(const char*, const char* payload)
|
void dispatch_exec(const char*, const char* payload)
|
||||||
{
|
{
|
||||||
File cmdfile = HASP_FS.open(payload, FILE_READ);
|
#if ARDUINO
|
||||||
|
File cmdfile = HASP_FS.open(payload, "r");
|
||||||
if(!cmdfile) return;
|
if(!cmdfile) return;
|
||||||
|
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
@ -1186,6 +1187,7 @@ void dispatch_exec(const char*, const char* payload)
|
|||||||
|
|
||||||
cmdfile.close();
|
cmdfile.close();
|
||||||
LOG_VERBOSE(TAG_MSGR, F("running %s complete"), payload);
|
LOG_VERBOSE(TAG_MSGR, F("running %s complete"), payload);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************* Commands builder *******************************************/
|
/******************************************* Commands builder *******************************************/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user