Merge pull request #1 from proddy/dev

Dev
This commit is contained in:
SpaceTeddy
2019-10-31 20:34:03 +01:00
committed by GitHub
16 changed files with 226 additions and 109 deletions

86
.travis.yml Normal file
View File

@@ -0,0 +1,86 @@
os: linux
language: python
python:
- "2.7"
cache:
directories:
- ${HOME}/.pio
env:
global:
# - BUILDER_TOTAL_THREADS=4
- BUILDER_TOTAL_THREADS=1
- OWNER=${TRAVIS_REPO_SLUG%/*}
- DEV=${OWNER/proddy/dev}
- BRANCH=${TRAVIS_BRANCH/dev/}
- TAG=${DEV}${BRANCH:+_}${BRANCH}
install:
- env | grep TRAVIS
- set -e
- pip install -U platformio
- pio platform update -p
- set +e
branches:
except:
- /^travis-.*-build$/
script:
- ./scripts/build.sh
# - ./scripts/build.sh -p
stages:
- name: Release
# if: type IN (cron, api)
jobs:
include:
- stage: Release
# env: BUILDER_THREAD=0
# - env: BUILDER_THREAD=1
# - env: BUILDER_THREAD=2
# - env: BUILDER_THREAD=3
before_deploy:
- export FIRMWARE_VERSION=$(grep -E '^#define APP_VERSION' ./src/version.h | awk '{print $3}' | sed 's/"//g')
- git tag -f travis-${TAG}-build
- git remote add gh
https://${OWNER}:${GITHUB_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
- git push gh :travis-${TAG}-build || true
- git push -f gh travis-${TAG}-build
- git remote remove gh
deploy:
provider: releases
edge:
branch: master
token: ${GITHUB_TOKEN}
file_glob: true
# file: "firmware/*.bin"
file: "*.bin"
name: latest development build
release_notes:
Version $FIRMWARE_VERSION.
Automatic firmware builds of the current EMS-ESP branch built on $(date +'%F %T %Z') from commit $TRAVIS_COMMIT.
Warning, this is a development build and not fully tested. Use at your own risk.
cleanup: false
prerelease: true
overwrite: true
target_commitish: $TRAVIS_COMMIT
on:
tags: false
branch: dev
notifications:
email:
on_success: change
on_failure: change
webhooks:
urls:
- https://webhooks.gitter.im/e/57e15f7798656d888194
on_success: change # options: [always|never|change] default: always
on_failure: never # options: [always|never|change] default: always
on_start: false # default: false

View File

@@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- Added `publish_always` forcing MQTT topics to be always sent regardless if the data hasn't changed - Added `publish_always` forcing MQTT topics to be always sent regardless if the data hasn't changed
- Support for DHW once (OneTime water) heating command via MQTT [issue 195](https://github.com/proddy/EMS-ESP/issues/195)
- Added scripts to automatically build firmware images on every Commit/Pull and nightly builds using TravisCI
- Added option to WebUI to also download the latest development build
### Fixed ### Fixed

View File

@@ -5,7 +5,7 @@
[![release-date](https://img.shields.io/github/release-date/proddy/EMS-ESP.svg?label=Released)](https://github.com/proddy/EMS-ESP/commits/master) [![release-date](https://img.shields.io/github/release-date/proddy/EMS-ESP.svg?label=Released)](https://github.com/proddy/EMS-ESP/commits/master)
<br /> <br />
[![license](https://img.shields.io/github/license/proddy/EMS-ESP.svg)](LICENSE) [![license](https://img.shields.io/github/license/proddy/EMS-ESP.svg)](LICENSE)
[![travis](https://travis-ci.com/proddy/EMS-ESP.svg?branch=master)](https://travis-ci.com/proddy/EMS-ESP) [![travis](https://travis-ci.com/proddy/EMS-ESP.svg?branch=dev)](https://travis-ci.com/proddy/EMS-ESP)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/b8880625bdf841d4adb2829732030887)](https://app.codacy.com/app/proddy/EMS-ESP?utm_source=github.com&utm_medium=referral&utm_content=proddy/EMS-ESP&utm_campaign=Badge_Grade_Settings) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/b8880625bdf841d4adb2829732030887)](https://app.codacy.com/app/proddy/EMS-ESP?utm_source=github.com&utm_medium=referral&utm_content=proddy/EMS-ESP&utm_campaign=Badge_Grade_Settings)
[![downloads](https://img.shields.io/github/downloads/proddy/EMS-ESP/total.svg)](https://github.com/proddy/EMS-ESP/releases) [![downloads](https://img.shields.io/github/downloads/proddy/EMS-ESP/total.svg)](https://github.com/proddy/EMS-ESP/releases)
<br /> <br />

7
scripts/build.sh Normal file → Executable file
View File

@@ -76,13 +76,16 @@ build_webui() {
build_environments() { build_environments() {
echo "--------------------------------------------------------------" echo "--------------------------------------------------------------"
echo "Building firmware images..." echo "Building firmware images..."
mkdir -p $destination/EMS-ESP-$version # don't move to firmware folder until Travis fixed (see https://github.com/travis-ci/dpl/issues/846#issuecomment-547157406)
# mkdir -p $destination
for environment in $environments; do for environment in $environments; do
echo "* EMS-ESP-$version-$environment.bin" echo "* EMS-ESP-$version-$environment.bin"
platformio run --silent --environment $environment || exit 1 platformio run --silent --environment $environment || exit 1
stat_bytes .pio/build/$environment/firmware.bin stat_bytes .pio/build/$environment/firmware.bin
mv .pio/build/$environment/firmware.bin $destination/EMS-ESP-$version/EMS-ESP-$version-$environment.bin # mv .pio/build/$environment/firmware.bin $destination/EMS-ESP-$version-$environment.bin
# mv .pio/build/$environment/firmware.bin EMS-ESP-$version-$environment.bin
mv .pio/build/$environment/firmware.bin EMS-ESP-dev-$environment.bin
done done
echo "--------------------------------------------------------------" echo "--------------------------------------------------------------"
} }

View File

@@ -2531,11 +2531,12 @@ void MyESP::_sendCustomStatus() {
JsonObject root = doc.to<JsonObject>(); JsonObject root = doc.to<JsonObject>();
root["command"] = "custom_status"; root["command"] = "custom_status";
root["version"] = _app_version; root["version"] = _app_version;
root["customname"] = _app_name; root["customname"] = _app_name;
root["appurl"] = _app_url; root["appurl"] = _app_url;
root["updateurl"] = _app_updateurl; root["updateurl"] = _app_updateurl;
root["updateurl_dev"] = _app_updateurl_dev;
// add specific custom stuff // add specific custom stuff
if (_web_callback_f) { if (_web_callback_f) {
@@ -2914,12 +2915,20 @@ void MyESP::_bootupSequence() {
} }
// setup MyESP // setup MyESP
void MyESP::begin(const char * app_hostname, const char * app_name, const char * app_version, const char * app_url, const char * app_updateurl) { void MyESP::begin(const char * app_hostname, const char * app_name, const char * app_version, const char * app_url, const char * app_url_api) {
_general_hostname = strdup(app_hostname); _general_hostname = strdup(app_hostname);
_app_name = strdup(app_name); _app_name = strdup(app_name);
_app_version = strdup(app_version); _app_version = strdup(app_version);
_app_url = strdup(app_url); _app_url = strdup(app_url);
_app_updateurl = strdup(app_updateurl);
char s[100];
strlcpy(s, app_url_api, sizeof(s));
strlcat(s, "/releases/latest", sizeof(s)); // append "/releases/latest"
_app_updateurl = strdup(s);
strlcpy(s, app_url_api, sizeof(s));
strlcat(s, "/releases/tags/travis-dev-build", sizeof(s)); // append "/releases/tags/travis-dev-build"
_app_updateurl_dev = strdup(s);
_telnet_setup(); // Telnet setup, called first to set Serial _telnet_setup(); // Telnet setup, called first to set Serial

View File

@@ -9,7 +9,7 @@
#ifndef MyESP_h #ifndef MyESP_h
#define MyESP_h #define MyESP_h
#define MYESP_VERSION "1.2.12" #define MYESP_VERSION "1.2.13"
#include <ArduinoJson.h> #include <ArduinoJson.h>
#include <ArduinoOTA.h> #include <ArduinoOTA.h>
@@ -308,7 +308,7 @@ class MyESP {
// general // general
void end(); void end();
void loop(); void loop();
void begin(const char * app_hostname, const char * app_name, const char * app_version, const char * app_url, const char * app_updateurl); void begin(const char * app_hostname, const char * app_name, const char * app_version, const char * app_url, const char * app_url_api);
void resetESP(); void resetESP();
int getWifiQuality(); int getWifiQuality();
void showSystemStats(); void showSystemStats();
@@ -407,6 +407,7 @@ class MyESP {
char * _app_version; char * _app_version;
char * _app_url; char * _app_url;
char * _app_updateurl; char * _app_updateurl;
char * _app_updateurl_dev;
bool _suspendOutput; bool _suspendOutput;
bool _general_serial; bool _general_serial;
bool _general_log_events; bool _general_log_events;

View File

@@ -31,7 +31,7 @@ DS18 ds18;
#define APP_NAME "EMS-ESP" #define APP_NAME "EMS-ESP"
#define APP_HOSTNAME "ems-esp" #define APP_HOSTNAME "ems-esp"
#define APP_URL "https://github.com/proddy/EMS-ESP" #define APP_URL "https://github.com/proddy/EMS-ESP"
#define APP_UPDATEURL "https://api.github.com/repos/proddy/EMS-ESP/releases/latest" #define APP_URL_API "https://api.github.com/repos/proddy/EMS-ESP"
// set to value >0 if the ESP is overheating or there are timing issues. Recommend a value of 1. // set to value >0 if the ESP is overheating or there are timing issues. Recommend a value of 1.
#define EMSESP_DELAY 0 // initially set to 0 for no delay. Change to 1 if getting WDT resets from wifi #define EMSESP_DELAY 0 // initially set to 0 for no delay. Change to 1 if getting WDT resets from wifi
@@ -116,7 +116,7 @@ static const command_t project_cmds[] PROGMEM = {
{true, "publish_time <seconds>", "set frequency for publishing data to MQTT (0=off)"}, {true, "publish_time <seconds>", "set frequency for publishing data to MQTT (0=off)"},
{true, "publish_always <on | off>", "set to on to skip payload comparison since last publish"}, {true, "publish_always <on | off>", "set to on to skip payload comparison since last publish"},
{true, "tx_mode <n>", "changes Tx logic. 1=ems generic, 2=ems+, 3=Junkers HT3"}, {true, "tx_mode <n>", "changes Tx logic. 1=EMS generic, 2=EMS+, 3=HT3"},
{false, "info", "show current captured on the devices"}, {false, "info", "show current captured on the devices"},
{false, "log <n | b | t | s | r | j | v>", "set logging mode to none, basic, thermostat only, solar module only, raw, jabber or verbose"}, {false, "log <n | b | t | s | r | j | v>", "set logging mode to none, basic, thermostat only, solar module only, raw, jabber or verbose"},
@@ -237,7 +237,7 @@ void showInfo() {
myDebug_P(PSTR("\n%sEMS Bus stats:%s"), COLOR_BOLD_ON, COLOR_BOLD_OFF); myDebug_P(PSTR("\n%sEMS Bus stats:%s"), COLOR_BOLD_ON, COLOR_BOLD_OFF);
if (ems_getBusConnected()) { if (ems_getBusConnected()) {
myDebug_P(PSTR(" Bus is connected, protocol: %s"), ((EMS_Sys_Status.emsIDMask == 0x80) ? "Junkers HT3" : "Buderus")); myDebug_P(PSTR(" Bus is connected, protocol: %s"), ((EMS_Sys_Status.emsIDMask == 0x80) ? "HT3" : "Buderus"));
myDebug_P(PSTR(" Rx: # successful read requests=%d, # CRC errors=%d"), EMS_Sys_Status.emsRxPgks, EMS_Sys_Status.emxCrcErr); myDebug_P(PSTR(" Rx: # successful read requests=%d, # CRC errors=%d"), EMS_Sys_Status.emsRxPgks, EMS_Sys_Status.emxCrcErr);
if (ems_getTxCapable()) { if (ems_getTxCapable()) {
@@ -1492,11 +1492,11 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
char topic_s[50]; char topic_s[50];
char buffer[4]; char buffer[4];
for (uint8_t hc = 1; hc <= EMS_THERMOSTAT_MAXHC; hc++) { for (uint8_t hc = 1; hc <= EMS_THERMOSTAT_MAXHC; hc++) {
strlcpy(topic_s, TOPIC_THERMOSTAT_CMD_TEMP, sizeof(topic_s)); strlcpy(topic_s, TOPIC_THERMOSTAT_CMD_TEMP_HA, sizeof(topic_s));
strlcat(topic_s, itoa(hc, buffer, 10), sizeof(topic_s)); strlcat(topic_s, itoa(hc, buffer, 10), sizeof(topic_s));
myESP.mqttSubscribe(topic_s); myESP.mqttSubscribe(topic_s);
strlcpy(topic_s, TOPIC_THERMOSTAT_CMD_MODE, sizeof(topic_s)); strlcpy(topic_s, TOPIC_THERMOSTAT_CMD_MODE_HA, sizeof(topic_s));
strlcat(topic_s, itoa(hc, buffer, 10), sizeof(topic_s)); strlcat(topic_s, itoa(hc, buffer, 10), sizeof(topic_s));
myESP.mqttSubscribe(topic_s); myESP.mqttSubscribe(topic_s);
} }
@@ -2016,7 +2016,7 @@ void setup() {
myESP.setSettings(LoadSaveCallback, SetListCallback, false); // default is Serial off myESP.setSettings(LoadSaveCallback, SetListCallback, false); // default is Serial off
myESP.setWeb(WebCallback); // web custom settings myESP.setWeb(WebCallback); // web custom settings
myESP.setOTA(OTACallback_pre, OTACallback_post); // OTA callback which is called when OTA is starting and stopping myESP.setOTA(OTACallback_pre, OTACallback_post); // OTA callback which is called when OTA is starting and stopping
myESP.begin(APP_HOSTNAME, APP_NAME, APP_VERSION, APP_URL, APP_UPDATEURL); myESP.begin(APP_HOSTNAME, APP_NAME, APP_VERSION, APP_URL, APP_URL_API);
// at this point we have all the settings from our internall SPIFFS config file // at this point we have all the settings from our internall SPIFFS config file
// fire up the UART now // fire up the UART now

View File

@@ -187,8 +187,8 @@ const _EMS_Type EMS_Types[] = {
{EMS_MODEL_ALL, EMS_TYPE_JunkersStatusMessage, "JunkersStatusMessage", _process_JunkersStatusMessage}, {EMS_MODEL_ALL, EMS_TYPE_JunkersStatusMessage, "JunkersStatusMessage", _process_JunkersStatusMessage},
// Mixing devices // Mixing devices
{EMS_MODEL_MM100, EMS_TYPE_MMPLUSStatusMessage_HC1, "MMPLUSStatusMessage_HC1", _process_MMPLUSStatusMessage}, {EMS_MODEL_MM, EMS_TYPE_MMPLUSStatusMessage_HC1, "MMPLUSStatusMessage_HC1", _process_MMPLUSStatusMessage},
{EMS_MODEL_MM100, EMS_TYPE_MMPLUSStatusMessage_HC2, "MMPLUSStatusMessage_HC2", _process_MMPLUSStatusMessage}, {EMS_MODEL_MM, EMS_TYPE_MMPLUSStatusMessage_HC2, "MMPLUSStatusMessage_HC2", _process_MMPLUSStatusMessage},
}; };
@@ -589,11 +589,13 @@ void _ems_sendTelegram() {
// we don't remove from the queue yet // we don't remove from the queue yet
_EMS_TxTelegram EMS_TxTelegram = EMS_TxQueue.first(); _EMS_TxTelegram EMS_TxTelegram = EMS_TxQueue.first();
/*
// if there is no destination, also delete it from the queue // if there is no destination, also delete it from the queue
if (EMS_TxTelegram.dest == EMS_ID_NONE) { if (EMS_TxTelegram.dest == EMS_ID_NONE) {
EMS_TxQueue.shift(); // remove from queue EMS_TxQueue.shift(); // remove from queue
return; return;
} }
*/
// if we're in raw mode just fire and forget // if we're in raw mode just fire and forget
if (EMS_TxTelegram.action == EMS_TX_TELEGRAM_RAW) { if (EMS_TxTelegram.action == EMS_TX_TELEGRAM_RAW) {
@@ -1520,9 +1522,11 @@ void _process_RCPLUSStatusMessage(_EMS_RxTelegram * EMS_RxTelegram) {
case EMS_OFFSET_RCPLUSStatusMessage_currsetpoint: // current setpoint temp, e.g. Thermostat -> all, telegram: 10 00 FF 06 01 A5 22 case EMS_OFFSET_RCPLUSStatusMessage_currsetpoint: // current setpoint temp, e.g. Thermostat -> all, telegram: 10 00 FF 06 01 A5 22
EMS_Thermostat.hc[hc].setpoint_roomTemp = _toByte(0); // value is * 2 EMS_Thermostat.hc[hc].setpoint_roomTemp = _toByte(0); // value is * 2
break; break;
case EMS_OFFSET_RCPLUSStatusMessage_mode: // thermostat mode auto/manual case EMS_OFFSET_RCPLUSStatusMessage_mode: // thermostat mode auto/manual
// manual : 10 00 FF 0A 01 A5 02 // manual : 10 00 FF 0A 01 A5 02
// auto : Thermostat -> all, type 0x01A5 telegram: 10 00 FF 0A 01 A5 03 // auto : Thermostat -> all, type 0x01A5 telegram: 10 00 FF 0A 01 A5 03
// TODO this may be bit 2 instead of 1 on an RC300 - still to validate
EMS_Thermostat.hc[hc].mode = _bitRead(0, 0); // bit 1, mode (auto=1 or manual=0) EMS_Thermostat.hc[hc].mode = _bitRead(0, 0); // bit 1, mode (auto=1 or manual=0)
EMS_Thermostat.hc[hc].day_mode = _bitRead(0, 1); // get day mode flag EMS_Thermostat.hc[hc].day_mode = _bitRead(0, 1); // get day mode flag
@@ -2521,8 +2525,10 @@ void ems_scanDevices() {
std::list<uint8_t> Device_Ids; // create a new list std::list<uint8_t> Device_Ids; // create a new list
// add boiler device_id which is always 0x08
Device_Ids.push_back(EMS_ID_BOILER); Device_Ids.push_back(EMS_ID_BOILER); // add boiler device_id which is always 0x08
Device_Ids.push_back(EMS_ID_HP); // add heat pump
Device_Ids.push_back(EMS_ID_SM); // add solar module
// copy over thermostats // copy over thermostats
for (_Thermostat_Device tt : Thermostat_Devices) { for (_Thermostat_Device tt : Thermostat_Devices) {
@@ -2534,9 +2540,6 @@ void ems_scanDevices() {
Device_Ids.push_back(ot.device_id); Device_Ids.push_back(ot.device_id);
} }
Device_Ids.push_back(EMS_ID_HP); // add heat pump
Device_Ids.push_back(EMS_ID_SM); // add solar module
// remove duplicates and reserved IDs (like our own device) // remove duplicates and reserved IDs (like our own device)
Device_Ids.sort(); Device_Ids.sort();
Device_Ids.unique(); Device_Ids.unique();

View File

@@ -186,7 +186,7 @@ const _EMS_TxTelegram EMS_TX_TELEGRAM_NEW = {
// where defintions are stored // where defintions are stored
typedef struct { typedef struct {
uint8_t product_id; uint8_t product_id;
char model_string[80]; char model_string[100];
} _Boiler_Device; } _Boiler_Device;
typedef struct { typedef struct {

View File

@@ -160,16 +160,12 @@ typedef enum {
EMS_MODEL_NONE, // unset EMS_MODEL_NONE, // unset
EMS_MODEL_ALL, // common for all devices EMS_MODEL_ALL, // common for all devices
// heatpump EMS_MODEL_HP, // heatpump
EMS_MODEL_HP, EMS_MODEL_SM, // solar module
EMS_MODEL_MM, // mixer module
EMS_MODEL_UBA, // boiler
// solar module // and the various thermostats
EMS_MODEL_SM,
// boiler
EMS_MODEL_UBA,
// and the thermostats
EMS_MODEL_ES73, EMS_MODEL_ES73,
EMS_MODEL_RC10, EMS_MODEL_RC10,
EMS_MODEL_RC20, EMS_MODEL_RC20,
@@ -187,9 +183,8 @@ typedef enum {
EMS_MODEL_FR100, EMS_MODEL_FR100,
EMS_MODEL_FR110, EMS_MODEL_FR110,
EMS_MODEL_FW120, EMS_MODEL_FW120,
EMS_MODEL_FW200,
// mixing devices EMS_MODEL_FR120
EMS_MODEL_MM100
} _EMS_MODEL_ID; } _EMS_MODEL_ID;
@@ -205,7 +200,7 @@ const _Boiler_Device Boiler_Devices[] = {
{203, "Buderus Logamax U122/Junkers Cerapur"}, {203, "Buderus Logamax U122/Junkers Cerapur"},
{208, "Buderus Logamax plus/GB192/Bosch Condens GC9000"}, {208, "Buderus Logamax plus/GB192/Bosch Condens GC9000"},
{64, "Sieger BK13,BK15/Nefit Smartline/Buderus GB1x2"}, {64, "Sieger BK13,BK15/Nefit Smartline/Buderus GB1x2"},
{95, "Bosch Condens 2500/Buderus Logamax GB062/Junkers Cerapur Top/Junkers HT3"}, {95, "Bosch Condens 2500/Buderus Logamax GB062/Junkers Cerapur Top/Worcester Greenstar i/Generic HT3"},
{122, "Nefit Proline"}, {122, "Nefit Proline"},
{170, "Buderus Logano GB212"}, {170, "Buderus Logano GB212"},
{172, "Nefit Enviline"} {172, "Nefit Enviline"}
@@ -235,7 +230,10 @@ const _Mixing_Device Mixing_Devices[] = {
{160, "MM100 Mixing Module"}, {160, "MM100 Mixing Module"},
{161, "MM200 Mixing Module"}, {161, "MM200 Mixing Module"},
{69, "MM10 Mixer Module"}, {69, "MM10 Mixer Module"},
{159, "MM50 Mixing Module"} {159, "MM50 Mixing Module"},
{79, "MM100 Mixer Module"},
{80, "MM200 Mixer Module"},
{78, "MM400 Mixer Module"}
}; };
@@ -251,7 +249,7 @@ const _Other_Device Other_Devices[] = {
{125, 0x09, "BC25 Base Controller"}, {125, 0x09, "BC25 Base Controller"},
{169, 0x09, "BC40 Base Controller"}, {169, 0x09, "BC40 Base Controller"},
{152, 0x09, "Junkers Controller"}, {152, 0x09, "Junkers Controller"},
{95, 0x09, "Junkers Controller"}, {95, 0x09, "HT3 Controller"},
{230, 0x09, "BC Base Controller"}, {230, 0x09, "BC Base Controller"},
{205, 0x02, "Nefit Moduline Easy Connect"}, {205, 0x02, "Nefit Moduline Easy Connect"},
@@ -274,6 +272,7 @@ const _HeatPump_Device HeatPump_Devices[] = {
/* /*
* Known thermostat types and their capabilities * Known thermostat types and their capabilities
* format is MODEL_ID, PRODUCT ID, DEVICE ID, DESCRIPTION * format is MODEL_ID, PRODUCT ID, DEVICE ID, DESCRIPTION
* Typically on DeviceID 0x10 or 0x18
*/ */
const _Thermostat_Device Thermostat_Devices[] = { const _Thermostat_Device Thermostat_Devices[] = {
@@ -297,9 +296,11 @@ const _Thermostat_Device Thermostat_Devices[] = {
// Junkers // Junkers
{EMS_MODEL_FW100, 105, 0x10, "Junkers FW100", EMS_THERMOSTAT_WRITE_NO}, {EMS_MODEL_FW100, 105, 0x10, "Junkers FW100", EMS_THERMOSTAT_WRITE_NO},
{EMS_MODEL_FR10, 111, 0x18, "Junkers FR10", EMS_THERMOSTAT_WRITE_NO}, {EMS_MODEL_FW200, 106, 0x10, "Junkers FW200", EMS_THERMOSTAT_WRITE_NO},
{EMS_MODEL_FR100, 105, 0x18, "Junkers FR100", EMS_THERMOSTAT_WRITE_NO}, {EMS_MODEL_FR100, 107, 0x18, "Junkers FR100", EMS_THERMOSTAT_WRITE_NO},
{EMS_MODEL_FR110, 108, 0x18, "Junkers FR110", EMS_THERMOSTAT_WRITE_NO}, {EMS_MODEL_FR110, 108, 0x18, "Junkers FR110", EMS_THERMOSTAT_WRITE_NO},
{EMS_MODEL_FR10, 111, 0x18, "Junkers FR10", EMS_THERMOSTAT_WRITE_NO},
{EMS_MODEL_FR120, 191, 0x10, "Junkers FR120", EMS_THERMOSTAT_WRITE_NO},
{EMS_MODEL_FW120, 192, 0x10, "Junkers FW120", EMS_THERMOSTAT_WRITE_NO}, {EMS_MODEL_FW120, 192, 0x10, "Junkers FW120", EMS_THERMOSTAT_WRITE_NO},
{EMS_MODEL_FR50, 147, 0x10, "Junkers FR50", EMS_THERMOSTAT_WRITE_NO} {EMS_MODEL_FR50, 147, 0x10, "Junkers FR50", EMS_THERMOSTAT_WRITE_NO}

View File

@@ -1 +1 @@
#define APP_VERSION "1.9.4b1" #define APP_VERSION "1.9.4b4"

View File

@@ -194,7 +194,10 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div> <div>
<h4>Latest Stable Release</h4> <div>
<button id="updateb" onclick="switchfirmware()" type="submit" class="btn btn-success btn-sm pull-right">Official Release</button>
</div>
<div id="onlineupdate"> <div id="onlineupdate">
<h5 id=releasehead></h5> <h5 id=releasehead></h5>
<div style="clear:both;"> <div style="clear:both;">

View File

@@ -8,6 +8,24 @@ var ajaxobj;
var custom_config = {}; var custom_config = {};
var xDown = null;
var yDown = null;
var page = 1;
var haspages;
var file = {};
var backupstarted = false;
var updateurl = "";
var updateurl_dev = "";
var use_beta_firmware = false;
var myespcontent;
var formData = new FormData();
var nextIsNotJson = false;
var config = { var config = {
"command": "configfile", "command": "configfile",
"network": { "network": {
@@ -40,14 +58,6 @@ var config = {
} }
}; };
var page = 1;
var haspages;
var file = {};
var backupstarted = false;
var updateurl = "";
var myespcontent;
function browserTime() { function browserTime() {
var d = new Date(0); var d = new Date(0);
var c = new Date(); var c = new Date();
@@ -209,8 +219,6 @@ function savenetwork() {
saveconfig(); saveconfig();
} }
var formData = new FormData();
function inProgress(callback) { function inProgress(callback) {
$("body").load("myesp.html #progresscontent", function (responseTxt, statusTxt, xhr) { $("body").load("myesp.html #progresscontent", function (responseTxt, statusTxt, xhr) {
if (statusTxt === "success") { if (statusTxt === "success") {
@@ -510,6 +518,7 @@ function getContent(contentname) {
$("#appurl2").text(ajaxobj.appurl); $("#appurl2").text(ajaxobj.appurl);
updateurl = ajaxobj.updateurl; updateurl = ajaxobj.updateurl;
updateurl_dev = ajaxobj.updateurl_dev;
listCustomStats(); listCustomStats();
break; break;
default: default:
@@ -734,8 +743,6 @@ function initMQTTLogTable() {
}); });
} }
var nextIsNotJson = false;
function socketMessageListener(evt) { function socketMessageListener(evt) {
var obj = JSON.parse(evt.data); var obj = JSON.parse(evt.data);
if (obj.hasOwnProperty("command")) { if (obj.hasOwnProperty("command")) {
@@ -814,46 +821,6 @@ function restart() {
inProgress("restart"); inProgress("restart");
} }
$("#dismiss, .overlay").on("click", function () {
$("#sidebar").removeClass("active");
$(".overlay").fadeOut();
});
$("#sidebarCollapse").on("click", function () {
$("#sidebar").addClass("active");
$(".overlay").fadeIn();
$(".collapse.in").toggleClass("in");
$("a[aria-expanded=true]").attr("aria-expanded", "false");
});
$("#custom_status").click(function () {
websock.send("{\"command\":\"custom_status\"}");
return false;
});
$("#status").click(function () {
websock.send("{\"command\":\"status\"}");
return false;
});
$("#custom").click(function () { getContent("#customcontent"); return false; });
$("#network").on("click", (function () { getContent("#networkcontent"); return false; }));
$("#general").click(function () { getContent("#generalcontent"); return false; });
$("#mqtt").click(function () { getContent("#mqttcontent"); return false; });
$("#ntp").click(function () { getContent("#ntpcontent"); return false; });
$("#backup").click(function () { getContent("#backupcontent"); return false; });
$("#reset").click(function () { $("#destroy").modal("show"); return false; });
$("#restart").click(function () { $("#reboot").modal("show"); return false; });
$("#eventlog").click(function () { getContent("#eventcontent"); return false; });
$(".noimp").on("click", function () {
$("#noimp").modal("show");
});
var xDown = null;
var yDown = null;
function handleTouchStart(evt) { function handleTouchStart(evt) {
xDown = evt.touches[0].clientX; xDown = evt.touches[0].clientX;
yDown = evt.touches[0].clientY; yDown = evt.touches[0].clientY;
@@ -953,8 +920,26 @@ function login() {
} }
} }
function switchfirmware() {
if (use_beta_firmware) {
use_beta_firmware = false;
document.getElementById("updateb").innerHTML = "Official Release";
} else {
use_beta_firmware = true;
document.getElementById("updateb").innerHTML = "Development Build";
}
getLatestReleaseInfo();
}
function getLatestReleaseInfo() { function getLatestReleaseInfo() {
$.getJSON(updateurl).done(function (release) {
if (use_beta_firmware) {
var url = updateurl_dev;
} else {
var url = updateurl;
}
$.getJSON(url).done(function (release) {
var asset = release.assets[0]; var asset = release.assets[0];
var downloadCount = 0; var downloadCount = 0;
for (var i = 0; i < release.assets.length; i++) { for (var i = 0; i < release.assets.length; i++) {
@@ -978,10 +963,6 @@ function getLatestReleaseInfo() {
}).error(function () { $("#onlineupdate").html("<h5>Couldn't get release details. Make sure there is an Internet connection.</h5>"); }); }).error(function () { $("#onlineupdate").html("<h5>Couldn't get release details. Make sure there is an Internet connection.</h5>"); });
} }
$("#update").on("shown.bs.modal", function (e) {
getLatestReleaseInfo();
});
function allowUpload() { function allowUpload() {
$("#upbtn").prop("disabled", false); $("#upbtn").prop("disabled", false);
} }
@@ -1014,5 +995,31 @@ function refreshStatus() {
websock.send("{\"command\":\"status\"}"); websock.send("{\"command\":\"status\"}");
} }
$("#dismiss, .overlay").on("click", function () {
$("#sidebar").removeClass("active");
$(".overlay").fadeOut();
});
$("#sidebarCollapse").on("click", function () {
$("#sidebar").addClass("active");
$(".overlay").fadeIn();
$(".collapse.in").toggleClass("in");
$("a[aria-expanded=true]").attr("aria-expanded", "false");
});
$("#custom_status").click(function () { websock.send("{\"command\":\"custom_status\"}"); return false; });
$("#status").click(function () { websock.send("{\"command\":\"status\"}"); return false; });
$("#custom").click(function () { getContent("#customcontent"); return false; });
$("#network").on("click", (function () { getContent("#networkcontent"); return false; }));
$("#general").click(function () { getContent("#generalcontent"); return false; });
$("#mqtt").click(function () { getContent("#mqttcontent"); return false; });
$("#ntp").click(function () { getContent("#ntpcontent"); return false; });
$("#backup").click(function () { getContent("#backupcontent"); return false; });
$("#reset").click(function () { $("#destroy").modal("show"); return false; });
$("#restart").click(function () { $("#reboot").modal("show"); return false; });
$("#eventlog").click(function () { getContent("#eventcontent"); return false; });
$(".noimp").on("click", function () { $("#noimp").modal("show"); });
$("#update").on("shown.bs.modal", function (e) { getLatestReleaseInfo(); });
document.addEventListener("touchstart", handleTouchStart, false); document.addEventListener("touchstart", handleTouchStart, false);
document.addEventListener("touchmove", handleTouchMove, false); document.addEventListener("touchmove", handleTouchMove, false);

2
tools/wsemulator/run.ps1 Normal file → Executable file
View File

@@ -2,7 +2,7 @@ $ScriptDir = Split-Path $script:MyInvocation.MyCommand.Path
# build web # build web
$webfilesbuilder = $ScriptDir + "\..\webfilesbuilder" $webfilesbuilder = $ScriptDir + "\..\webfilesbuilder"
node $webfilesbuilder\node_modules\gulp\bin\gulp.js --cwd $webfilesbuilder node $webfilesbuilder\node_modules\gulp\bin\gulp.js --silent --cwd $webfilesbuilder
# run chrome # run chrome
$pathToChrome = 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe' $pathToChrome = 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'

2
tools/wsemulator/run.sh Normal file → Executable file
View File

@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
node $PWD/../webfilesbuilder/node_modules/gulp/bin/gulp.js --cwd $PWD/../webfilesbuilder node $PWD/../webfilesbuilder/node_modules/gulp/bin/gulp.js --cwd $PWD/../webfilesbuilder
open -na Google\ Chrome --args --disable-web-security --remote-debugging-port=9222 --user-data-dir="/tmp/chrome_dev" $PWD/../../src/websrc/temp/index.html open -na Google\ Chrome --args --disable-web-security --remote-debugging-port=9222 --user-data-dir="/tmp/chrome_dev" $PWD/../../src/websrc/temp/index.html

View File

@@ -156,6 +156,7 @@ function sendCustomStatus() {
"customname": "EMS-ESP", "customname": "EMS-ESP",
"appurl": "https://github.com/proddy/EMS-ESP", "appurl": "https://github.com/proddy/EMS-ESP",
"updateurl": "https://api.github.com/repos/proddy/EMS-ESP/releases/latest", "updateurl": "https://api.github.com/repos/proddy/EMS-ESP/releases/latest",
"updateurl_dev": "https://api.github.com/repos/proddy/EMS-ESP/releases/tags/travis-dev-build",
"emsbus": { "emsbus": {
"ok": true, "ok": true,