forked from letscontrolit/ESPEasy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request letscontrolit#3640 from TD-er/feature/fetchConfig
[Provisioning] Allow to fetch config via commands from HTTP server
- Loading branch information
Showing
34 changed files
with
941 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#include "../Commands/Provisioning.h" | ||
|
||
|
||
#ifdef USE_CUSTOM_PROVISIONING | ||
|
||
# include "../Commands/Common.h" | ||
|
||
# include "../../ESPEasy_common.h" | ||
# include "../DataTypes/ESPEasyFileType.h" | ||
# include "../DataStructs/ESPEasy_EventStruct.h" | ||
# include "../Helpers/ESPEasy_Storage.h" | ||
|
||
|
||
String Command_Provisioning_Config(struct EventStruct *event, const char *Line) | ||
{ | ||
return downloadFileType(FileType::CONFIG_DAT); | ||
} | ||
|
||
String Command_Provisioning_Security(struct EventStruct *event, const char *Line) | ||
{ | ||
return downloadFileType(FileType::SECURITY_DAT); | ||
} | ||
|
||
String Command_Provisioning_Notification(struct EventStruct *event, const char *Line) | ||
{ | ||
return downloadFileType(FileType::NOTIFICATION_DAT); | ||
} | ||
|
||
String Command_Provisioning_Provision(struct EventStruct *event, const char *Line) | ||
{ | ||
return downloadFileType(FileType::PROVISIONING_DAT); | ||
} | ||
|
||
String Command_Provisioning_Rules(struct EventStruct *event, const char *Line) | ||
{ | ||
if ((event->Par1 <= 0) || (event->Par1 > 4)) { | ||
return F("ProvisionRules: rules index out of range"); | ||
} | ||
return downloadFileType(FileType::RULES_TXT, event->Par1 - 1); | ||
} | ||
|
||
#endif // ifdef USE_CUSTOM_PROVISIONING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ifndef COMMANDS_PROVISIONING_H | ||
#define COMMANDS_PROVISIONING_H | ||
|
||
#include "../../ESPEasy_common.h" | ||
|
||
#ifdef USE_CUSTOM_PROVISIONING | ||
|
||
class String; | ||
|
||
String Command_Provisioning_Config(struct EventStruct *event, | ||
const char *Line); | ||
String Command_Provisioning_Security(struct EventStruct *event, | ||
const char *Line); | ||
String Command_Provisioning_Notification(struct EventStruct *event, | ||
const char *Line); | ||
String Command_Provisioning_Provision(struct EventStruct *event, | ||
const char *Line); | ||
String Command_Provisioning_Rules(struct EventStruct *event, | ||
const char *Line); | ||
|
||
|
||
#endif // ifdef USE_CUSTOM_PROVISIONING | ||
|
||
#endif // ifndef COMMANDS_PROVISIONING_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.