Browse Source

Undo failed merge

- Sorry for the mess
pull/157/head
Andreas Schiffler 3 years ago
parent
commit
8a02c62995
  1. 40
      tools/esp8266/app.cpp
  2. 2
      tools/esp8266/app.h
  3. 13
      tools/esp8266/scripts/getVersion.py

40
tools/esp8266/app.cpp

@ -539,48 +539,10 @@ String app::getStatistics(void) {
return content;
}
//-----------------------------------------------------------------------------
void app::webapi(void) { // ToDo
DPRINTLN(DBG_VERBOSE, F("app::api"));
DPRINTLN(DBG_DEBUG, mWeb->arg("plain"));
const size_t capacity = 200; // Use arduinojson.org/assistant to compute the capacity.
DynamicJsonDocument payload(capacity);
// Parse JSON object
deserializeJson(payload, mWeb->arg("plain"));
// ToDo: error handling for payload
if (payload["tx_request"] == TX_REQ_INFO){
mSys->InfoCmd = payload["cmd"];
DPRINTLN(DBG_INFO, F("Will make tx-request 0x15 with subcmd ") + String(mSys->InfoCmd));
}
mWeb->send ( 200, "text/json", "{success:true}" );
}
//-----------------------------------------------------------------------------
void app::showHoymiles(void) {
DPRINTLN(DBG_VERBOSE, F("app::showHoymiles"));
String html = FPSTR(hoymiles_html);
html.replace(F("{DEVICE}"), mDeviceName);
html.replace(F("{VERSION}"), mVersion);
html.replace(F("{TS}"), String(mSendInterval) + " ");
html.replace(F("{JS_TS}"), String(mSendInterval * 1000));
mWeb->send(200, F("text/html"), html);
}
//-----------------------------------------------------------------------------
void app::showFavicon(void) {
DPRINTLN(DBG_VERBOSE, F("app::showFavicon"));
static const char favicon_type[] PROGMEM = "image/x-icon";
static const char favicon_content[] PROGMEM = FAVICON_PANEL_16;
mWeb->send_P(200, favicon_type, favicon_content, sizeof(favicon_content));
}
//-----------------------------------------------------------------------------
void app::showLiveData(void) {
DPRINTLN(DBG_VERBOSE, F("app::showLiveData"));
String app::getLiveData(void) {
String modHtml;
for(uint8_t id = 0; id < mSys->getNumInverters(); id++) {
Inverter<> *iv = mSys->getInverterByPos(id);

2
tools/esp8266/app.h

@ -29,7 +29,7 @@
//
// #define __MQTT_TEST__ // MQTT Interval wird auf 10 Sekunden verkürzt ( nur für testzwecke )
#define __MQTT_AFTER_RX__ // versendet die MQTT Daten sobald die WR daten Aufbereitet wurden ( gehört eigentlich ins Setup )
#define __MQTT_NO_DISCOVERCONFIG__ // das versenden der MQTTDiscoveryConfig abschalten ( gehört eigentlich ins Setup )
// #define __MQTT_NO_DISCOVERCONFIG__ // das versenden der MQTTDiscoveryConfig abschalten ( gehört eigentlich ins Setup )
typedef CircularBuffer<packet_t, PACKET_BUFFER_SIZE> BufferType;
typedef HmRadio<DEF_RF24_CE_PIN, DEF_RF24_CS_PIN, BufferType> RadioType;

13
tools/esp8266/scripts/getVersion.py

@ -1,9 +1,5 @@
import os
from datetime import date
import subprocess
def get_git_revision_short_hash() -> str:
return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode('ascii').strip()
def readVersion(path, infile):
f = open(path + infile, "r")
@ -22,15 +18,14 @@ def readVersion(path, infile):
os.mkdir(path + ".pio/build/out/")
versionout = version[:-1] + "_esp8266_debug_g" + get_git_revision_short_hash() + ".bin"
src = path + ".pio/build/esp8266-debug/firmware.bin"
versionout = version[:-1] + "_esp8266_release.bin"
src = path + ".pio/build/esp8266-release/firmware.bin"
dst = path + ".pio/build/out/" + versionout
os.rename(src, dst)
versionout = version[:-1] + "_esp8266_release_g" + get_git_revision_short_hash() + ".bin"
src = path + ".pio/build/esp8266-release/firmware.bin"
versionout = version[:-1] + "_esp8266_debug.bin"
src = path + ".pio/build/esp8266-debug/firmware.bin"
dst = path + ".pio/build/out/" + versionout
os.rename(src, dst)
readVersion("../", "defines.h")

Loading…
Cancel
Save