Skip to content

Commit

Permalink
remove restart command (supported directly via API lib) (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
sumnerboy12 authored Jul 13, 2022
1 parent f530c70 commit c643c50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=OXRS-SHA-Rack32-ESP32-LIB
version=2.3.0
version=2.4.0
author=SuperHouse Automation Pty Ltd
maintainer=Ben Jones <[email protected]>
sentence=ESP32 Rack32 library for Open eXtensible Rack System firmware
Expand Down
13 changes: 2 additions & 11 deletions src/OXRS_Rack32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,6 @@ void _getCommandSchemaJson(JsonVariant json)
{
_mergeJson(properties, _fwCommandSchema.as<JsonVariant>());
}

// Rack32 commands
JsonObject restart = properties.createNestedObject("restart");
restart["title"] = "Restart";
restart["type"] = "boolean";
}

/* API callbacks */
Expand Down Expand Up @@ -335,12 +330,6 @@ void _mqttConfig(JsonVariant json)

void _mqttCommand(JsonVariant json)
{
// Check for library commands
if (json.containsKey("restart") && json["restart"].as<bool>())
{
ESP.restart();
}

// Pass on to the firmware callback
if (_onCommand) { _onCommand(json); }
}
Expand Down Expand Up @@ -464,11 +453,13 @@ void OXRS_Rack32::loop(void)

void OXRS_Rack32::setConfigSchema(JsonVariant json)
{
_fwConfigSchema.clear();
_mergeJson(_fwConfigSchema.as<JsonVariant>(), json);
}

void OXRS_Rack32::setCommandSchema(JsonVariant json)
{
_fwCommandSchema.clear();
_mergeJson(_fwCommandSchema.as<JsonVariant>(), json);
}

Expand Down

0 comments on commit c643c50

Please sign in to comment.