Skip to content

Commit

Permalink
Add handling for optional FW_GITHUB_URL build arg (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
sumnerboy12 authored May 17, 2022
1 parent 88f4a33 commit 4498865
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 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.1.0
version=2.2.0
author=SuperHouse Automation Pty Ltd
maintainer=Ben Jones <[email protected]>
sentence=ESP32 Rack32 library for Open eXtensible Rack System firmware
Expand Down
16 changes: 10 additions & 6 deletions src/OXRS_Rack32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,14 @@ void _getFirmwareJson(JsonVariant json)
{
JsonObject firmware = json.createNestedObject("firmware");

firmware["name"] = STRINGIFY(FW_NAME);
firmware["shortName"] = STRINGIFY(FW_SHORT_NAME);
firmware["maker"] = STRINGIFY(FW_MAKER);
firmware["name"] = FW_NAME;
firmware["shortName"] = FW_SHORT_NAME;
firmware["maker"] = FW_MAKER;
firmware["version"] = STRINGIFY(FW_VERSION);

#if defined(FW_GITHUB_URL)
firmware["githubUrl"] = FW_GITHUB_URL;
#endif
}

void _getSystemJson(JsonVariant json)
Expand Down Expand Up @@ -153,7 +157,7 @@ void _getConfigSchemaJson(JsonVariant json)

// Config schema metadata
configSchema["$schema"] = JSON_SCHEMA_VERSION;
configSchema["title"] = STRINGIFY(FW_SHORT_NAME);
configSchema["title"] = FW_SHORT_NAME;
configSchema["type"] = "object";

JsonObject properties = configSchema.createNestedObject("properties");
Expand Down Expand Up @@ -211,7 +215,7 @@ void _getCommandSchemaJson(JsonVariant json)

// Command schema metadata
commandSchema["$schema"] = JSON_SCHEMA_VERSION;
commandSchema["title"] = STRINGIFY(FW_SHORT_NAME);
commandSchema["title"] = FW_SHORT_NAME;
commandSchema["type"] = "object";

JsonObject properties = commandSchema.createNestedObject("properties");
Expand Down Expand Up @@ -555,7 +559,7 @@ void OXRS_Rack32::_initialiseScreen(void)
_screen.begin();

// Display the firmware and logo (either from SPIFFS or PROGMEM)
int returnCode = _screen.drawHeader(STRINGIFY(FW_SHORT_NAME), STRINGIFY(FW_MAKER), STRINGIFY(FW_VERSION), "ESP32", _fwLogo);
int returnCode = _screen.drawHeader(FW_SHORT_NAME, FW_MAKER, STRINGIFY(FW_VERSION), "ESP32", _fwLogo);

switch (returnCode)
{
Expand Down

0 comments on commit 4498865

Please sign in to comment.