15 if (!SPIFFS.begin(
true)) {
16 Serial.println(
"Config: An error has occurred while mounting SPIFFS");
32 JsonArray espPinConfigs = doc[
"espPins"].as<JsonArray>();
33 for (JsonObject espPinConfig : espPinConfigs) {
35 const std::string address = espPinConfig[
"pin"];
36 int16_t pinPwrIncStep = espPinConfig[
"pwrIncStep"] | pwrIncStep;
37 int16_t pinPwrDecStep = espPinConfig[
"pwrDecStep"] | pwrDecStep;
38 const bool isInverted = espPinConfig[
"inverted"] |
false;
39 const std::string attachedDevice = espPinConfig[
"attachedDevice"] |
"nothing";
47 JsonArray locoConfigs = doc[
"locos"].as<JsonArray>();
48 for (JsonObject locoConfig : locoConfigs) {
50 const bool enabled = locoConfig[
"enabled"] |
true;
60 JsonArray locoConfigFiles = doc[
"locoConfigs"].as<JsonArray>();
61 for (
int i = 0; i < locoConfigFiles.size(); i++) {
62 const std::string locoConfigFile = locoConfigFiles[i];
66 JsonObject locoConfig = locoConfigDoc.as<JsonObject>();
69 const bool enabled = locoConfig[
"enabled"] |
true;
static BLELocomotiveConfiguration * Deserialize(JsonObject locoConfig, std::vector< MCChannelConfig * > espPins, int16_t defaultPwrIncStep, int16_t defaultPwrDecStep)
Definition BLELocomotiveDeserializer.cpp:5