Skip to content

Commit

Permalink
Merge pull request #93 from Gifford47/development
Browse files Browse the repository at this point in the history
Merge Development into Master
  • Loading branch information
Gifford47 authored Sep 20, 2024
2 parents 514164d + 90c4181 commit ba257c7
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 16 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,29 @@ jobs:
# find . -type d -name fw

# upload Release:
- name: Get current date
id: date
run: echo "DATE=$(date +%Y.%m.%d)" >> $GITHUB_OUTPUT
#- name: Get current date
# id: name
# run: echo "DATE=$(date +%Y.%m.%d)" >> $GITHUB_OUTPUT
- name: Get current release version
id: name
run: |
import os, re
with open(r'./HCPBridgeESP32/src/configuration.h') as f:
cont = f.read()
if 'HA_VERSION' in cont:
a = re.search(r'HA_VERSION = "(.*)"', cont)
res = a.group(1)
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
print(f'NAME={res}', file=fh)
shell: python
- name: Release
uses: softprops/action-gh-release@v2
#if: startsWith(github.ref, 'refs/tags/')
with:
name: ${{ steps.date.outputs.DATE }}
tag_name: ${{ steps.date.outputs.DATE }}
name: ${{ steps.name.outputs.NAME }}
tag_name: ${{ steps.name.outputs.NAME }}
#token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
generate_release_notes: true
make_latest: true
files: |
./HCPBridgeESP32/fw/*.bin
./HCPBridgeESP32/fw/*.bin
2 changes: 1 addition & 1 deletion HCPBridgeESP32/WebUI/index_html.h

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion HCPBridgeESP32/WebUI/webpage/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<style>
html {font-family: Arial; display: inline-block; text-align: center;}
h2 {font-size: 3.0rem;}
p {font-size: 3.0rem;}
p {font-size: 1rem;}
body {max-width: 600px; margin:0px auto; padding-bottom: 25px;}
.switch {position: relative; display: inline-block; width: 80px; height: 48px}
.switch input {display: none}
Expand Down Expand Up @@ -360,6 +360,7 @@ <h4>System information</h4>
<a class="link-gray" href="status" target="_blank">Door status</a>
</div>

<p id="swversion"></p>

<script>
document.getElementById("toogle_sysinfo").onclick = function() {collapse('sysinfo_links')};
Expand Down Expand Up @@ -533,6 +534,7 @@ <h4>System information</h4>
isconnected = status.valid;
document.getElementById("status").innerHTML = getStatusText(status.valid?status.doorstate:"NA");
document.getElementById("light").checked = status.light & status.valid;
document.getElementById("swversion").innerHTML = status.swversion;
if (status.hasOwnProperty('sensors')) {
var sdiv = document.getElementById("sensors")
sdiv.style.display = 'flex';
Expand Down
17 changes: 12 additions & 5 deletions HCPBridgeESP32/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[platformio]
;set your env you want to build default esp32 without any sensor. Comment line to build all environments.
;list separeted by , to build selected evns.
default_envs = esp32, esp32_BME280_HCSR04, m5stack-stamps3
default_envs = esp32, esp32_BME280_HCSR04, m5stack-stamps3, HCP_Giffordv1a, HCP_Giffordv1b

[common]
dht22libs =
Expand All @@ -32,21 +32,24 @@ monitor_speed = 9600
monitor_filters = esp32_exception_decoder
lib_ldf_mode = deep+
lib_deps =
esphome/ESPAsyncWebServer-esphome
https://github.com/HeMan/AsyncTCP #CI-and-fix ;async tcp issue fix 2.1.0
mathieucarbou/Async TCP @ ^3.1.4
heman/AsyncMqttClient-esphome@^2.1.0
bblanchon/ArduinoJson
plerup/EspSoftwareSerial
https://github.com/ayushsharma82/AsyncElegantOTA.git#v2.2.8
ottowinter/AsyncMqttClient-esphome
ayushsharma82/ElegantOTA@^3.1.5
paulstoffregen/OneWire
emelianov/modbus-esp8266
https://github.com/dok-net/ghostl ; << Fix missing circular_queue.h
adafruit/Adafruit Unified Sensor
adafruit/Adafruit BME280 Library
extra_scripts = pre:./WebUI/webpage/compress.py, pre:build_output.py
build_flags=-DELEGANTOTA_USE_ASYNC_WEBSERVER=1
;build_flags =
; -D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE
; -D DEBUG

[env:esp32]
lib_compat_mode = strict

[env:esp32_DS18X20]
lib_deps = ${env:esp32.lib_deps} ${common.ds18x20libs}
Expand Down Expand Up @@ -117,4 +120,8 @@ build_flags = ${env:m5stack-stamps3.build_flags} -D SENSORS -D USE_BME
extends = env:m5stack-stamps3_BME280
build_flags = ${env:m5stack-stamps3_BME280.build_flags} -D USE_HCSR04

[env:HCP_Giffordv1a]
build_flags = ${env:esp32.build_flags} -D SENSORS -D USE_HCSR04 -D USE_HCSR501 -D USE_BME

[env:HCP_Giffordv1b]
build_flags = ${env:esp32.build_flags} -D SENSORS -D USE_HCSR501 -D USE_BME
2 changes: 1 addition & 1 deletion HCPBridgeESP32/src/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@
const char *HA_ONLINE = "online";
const char *HA_OFFLINE = "offline";
#endif
const char *HA_VERSION = "0.0.7.0";
const char *HA_VERSION = "0.0.7.1";

#endif
9 changes: 7 additions & 2 deletions HCPBridgeESP32/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <Arduino.h>
#include <Esp.h>
#include <AsyncElegantOTA.h>
#include <ElegantOTA.h>
#include <ESPAsyncWebServer.h>
#include "AsyncJson.h"
#include <AsyncMqttClient.h>
Expand Down Expand Up @@ -1075,6 +1075,7 @@ void setup()
root["state"] = hoermannEngine->state->state;
root["busResponseAge"] = hoermannEngine->state->responseAge();
root["lastModbusRespone"] = hoermannEngine->state->lastModbusRespone;
root["swversion"] = HA_VERSION;
#ifdef SENSORS
JsonObject sensors = root.createNestedObject("sensors");
char buf[20];
Expand Down Expand Up @@ -1170,6 +1171,7 @@ void setup()
root["wifistatus"] = WiFi.status();
root["mqttstatus"] = mqttClient.connected();
root["resetreason"] = esp_reset_reason();
root["swversion"] = HA_VERSION;
serializeJson(root, *response);

request->send(response); });
Expand Down Expand Up @@ -1206,11 +1208,14 @@ void setup()
prefHandler.resetPreferences();
});

AsyncElegantOTA.begin(&server, OTA_USERNAME, OTA_PASSWD);
ElegantOTA.begin(&server);
ElegantOTA.setAutoReboot(true);
ElegantOTA.setAuth(OTA_USERNAME, OTA_PASSWD);

server.begin();
}

// mainloop
void loop(){
ElegantOTA.loop();
}

0 comments on commit ba257c7

Please sign in to comment.