mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
Merge branch 'dev' of https://github.com/emsesp/EMS-ESP32 into dev2
This commit is contained in:
13
.github/workflows/sonar_check.yml
vendored
13
.github/workflows/sonar_check.yml
vendored
@@ -1,30 +1,29 @@
|
||||
# see https://github.com/marketplace/actions/sonarcloud-scan-for-c-and-c#usage
|
||||
name: Sonar Check
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build and analyze
|
||||
runs-on: ubuntu-latest
|
||||
# if: github.repository_owner == 'emsesp'
|
||||
# if: github.repository == 'emsesp/EMS-ESP32'
|
||||
env:
|
||||
BUILD_WRAPPER_OUT_DIR: bw-output
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||
fetch-depth: 0
|
||||
- name: Install sonar-scanner and build-wrapper
|
||||
uses: SonarSource/sonarcloud-github-c-cpp@v2
|
||||
- name: Run build-wrapper
|
||||
run: |
|
||||
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make all
|
||||
run: build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make all
|
||||
- name: Run sonar-scanner
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
run: |
|
||||
sonar-scanner
|
||||
run: sonar-scanner --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
- CR120 thermostat as own model() [#1779](https://github.com/emsesp/EMS-ESP32/discussions/1779)
|
||||
- Modules - external linkable module library [#1778](https://github.com/emsesp/EMS-ESP32/issues/1778)
|
||||
- Scheduler onChange and Conditions [#1806](https://github.com/emsesp/EMS-ESP32/issues/1806)
|
||||
- make remote control timeout editable [#1774](https://github.com/emsesp/EMS-ESP32/issues/1774)
|
||||
|
||||
## Fixed
|
||||
|
||||
|
||||
@@ -120,7 +120,10 @@ const de: Translation = {
|
||||
BYPASS_TOKEN: 'Zugriffstoken-Autorisierung bei API-Aufrufen umgehen',
|
||||
READONLY: 'Nur-Lese-Modus aktivieren (blockiert alle ausgehenden EMS Tx Write-Befehle)',
|
||||
UNDERCLOCK_CPU: 'CPU-Geschwindigkeit untertakten',
|
||||
REMOTE_TIMEOUT: 'Timeout',
|
||||
REMOTE_TIMEOUT_EN: 'Deaktitiere Remote bei fehender Temperatur',
|
||||
HEATINGOFF: 'Heizen ausschalten beim EMS-ESP Start',
|
||||
MIN_DURATION: 'Dauer bis die Dusche erkannt wrid',
|
||||
ENABLE_SHOWER_TIMER: 'Duschtimer aktivieren',
|
||||
ENABLE_SHOWER_ALERT: 'Duschalarm aktivieren',
|
||||
TRIGGER_TIME: 'Auslösezeit',
|
||||
|
||||
@@ -120,7 +120,10 @@ const en: Translation = {
|
||||
BYPASS_TOKEN: 'Bypass Access Token authorization on API calls',
|
||||
READONLY: 'Enable read-only mode (blocks all outgoing EMS Tx Write commands)',
|
||||
UNDERCLOCK_CPU: 'Underclock CPU speed',
|
||||
REMOTE_TIMEOUT: 'Remote timeout',
|
||||
REMOTE_TIMEOUT_EN: 'Disable remote on missing roomtemperature',
|
||||
HEATINGOFF: 'Start boiler with forced heating off',
|
||||
MIN_DURATION: 'Time for detection shower',
|
||||
ENABLE_SHOWER_TIMER: 'Enable Shower Timer',
|
||||
ENABLE_SHOWER_ALERT: 'Enable Shower Alert',
|
||||
TRIGGER_TIME: 'Trigger Time',
|
||||
|
||||
@@ -121,6 +121,9 @@ const fr: Translation = {
|
||||
READONLY: 'Activer le mode lecture uniquement (bloque toutes les commandes EMS sortantes en écriture Tx)',
|
||||
UNDERCLOCK_CPU: 'Underclock du CPU',
|
||||
HEATINGOFF: 'Start boiler with forced heating off', // TODO translate
|
||||
REMOTE_TIMEOUT: 'Remote timeout',
|
||||
REMOTE_TIMEOUT_EN: 'Disable remote on missing roomtemperature',
|
||||
MIN_DURATION: 'Time for detection shower',
|
||||
ENABLE_SHOWER_TIMER: 'Activer la minuterie de la douche',
|
||||
ENABLE_SHOWER_ALERT: 'Activer les alertes de durée de douche',
|
||||
TRIGGER_TIME: 'Durée avant déclenchement',
|
||||
|
||||
@@ -120,7 +120,10 @@ const it: Translation = {
|
||||
BYPASS_TOKEN: 'Ignora autorizzazione del token di accesso sulle chiamate API',
|
||||
READONLY: 'Abilita modalità sola-lettura (blocca tutti i comandi di scrittura EMS Tx in uscita)',
|
||||
UNDERCLOCK_CPU: 'Abbassa velocità della CPU',
|
||||
REMOTE_TIMEOUT: 'Remote timeout',
|
||||
REMOTE_TIMEOUT_EN: 'Disable remote on missing roomtemperature',
|
||||
HEATINGOFF: 'Avviamento caldaia con riscaldamento forzato spento',
|
||||
MIN_DURATION: 'Time for detection shower',
|
||||
ENABLE_SHOWER_TIMER: 'Abilita timer doccia',
|
||||
ENABLE_SHOWER_ALERT: 'Abilita avviso doccia',
|
||||
TRIGGER_TIME: 'Tempo di avvio',
|
||||
|
||||
@@ -120,7 +120,10 @@ const nl: Translation = {
|
||||
BYPASS_TOKEN: 'API Access Token authenticatie uitschakelen',
|
||||
READONLY: 'Activeer read-only modus (blokkeert alle outgaande EMS Tx schrijf commandos)',
|
||||
UNDERCLOCK_CPU: 'Underclock CPU snelheid',
|
||||
REMOTE_TIMEOUT: 'Remote timeout',
|
||||
REMOTE_TIMEOUT_EN: 'Disable remote on missing roomtemperature',
|
||||
HEATINGOFF: 'Start ketel met geforceerde verwarming uit',
|
||||
MIN_DURATION: 'Time for detection shower',
|
||||
ENABLE_SHOWER_TIMER: 'Activeer Douche Timer (tijdmeting)',
|
||||
ENABLE_SHOWER_ALERT: 'Activeer Douchemelding',
|
||||
TRIGGER_TIME: 'Trigger tijd',
|
||||
|
||||
@@ -120,7 +120,10 @@ const no: Translation = {
|
||||
BYPASS_TOKEN: 'Utelat Aksess Token authorisering av API kall',
|
||||
READONLY: 'Aktiver read-only modus (blokker all EMS Tx Skriving)',
|
||||
UNDERCLOCK_CPU: 'Underklokking av prosessorhastighet',
|
||||
REMOTE_TIMEOUT: 'Remote timeout',
|
||||
REMOTE_TIMEOUT_EN: 'Disable remote control on missing roomtemperature',
|
||||
HEATINGOFF: 'Start boiler with forced heating off', // TODO translate
|
||||
MIN_DURATION: 'Time for detection shower',
|
||||
ENABLE_SHOWER_TIMER: 'Aktiver Dusjtimer',
|
||||
ENABLE_SHOWER_ALERT: 'Aktiver Dusj-varsling',
|
||||
TRIGGER_TIME: 'Aktiveringstid',
|
||||
|
||||
@@ -120,7 +120,10 @@ const pl: BaseTranslation = {
|
||||
BYPASS_TOKEN: 'Pomiń autoryzację tokenem w wywołaniach API',
|
||||
READONLY: 'Tryb pracy "tylko do odczytu" (blokuje wszystkie komendy zapisu na magistralę EMS)',
|
||||
UNDERCLOCK_CPU: 'Obniż taktowanie CPU',
|
||||
REMOTE_TIMEOUT: 'Remote timeout',
|
||||
REMOTE_TIMEOUT_EN: 'Disable remote control on missing roomtemperature',
|
||||
HEATINGOFF: 'Uruchom kocioł z wymuszonym wyłączonym grzaniem',
|
||||
MIN_DURATION: 'Time for detection shower',
|
||||
ENABLE_SHOWER_TIMER: 'Aktywuj minutnik prysznica',
|
||||
ENABLE_SHOWER_ALERT: 'Aktywuj alarm prysznica',
|
||||
TRIGGER_TIME: 'Wyzwalaj po czasie',
|
||||
|
||||
@@ -120,7 +120,10 @@ const sk: Translation = {
|
||||
BYPASS_TOKEN: 'Vynechajte autorizáciu prístupového tokenu pri volaniach API',
|
||||
READONLY: 'Povoliť režim len na čítanie (blokuje všetky odchádzajúce príkazy EMS Tx Write)',
|
||||
UNDERCLOCK_CPU: 'Podtaktovanie rýchlosti procesora',
|
||||
REMOTE_TIMEOUT: 'Remote timeout',
|
||||
REMOTE_TIMEOUT_EN: 'Disable remote on missing roomtemperature',
|
||||
HEATINGOFF: 'Spustiť kotol s vynúteným vykurovaním',
|
||||
MIN_DURATION: 'Time for detection shower',
|
||||
ENABLE_SHOWER_TIMER: 'Povoliť časovač sprchovania',
|
||||
ENABLE_SHOWER_ALERT: 'Povoliť upozornenie na sprchu',
|
||||
TRIGGER_TIME: 'Čas spustenia',
|
||||
|
||||
@@ -120,7 +120,10 @@ const sv: Translation = {
|
||||
BYPASS_TOKEN: 'Inaktivera Token-autensiering för API-anrop',
|
||||
READONLY: 'Aktivera read-only (blockerar alla utgående skrivkommandon mot EMS-bussen)',
|
||||
UNDERCLOCK_CPU: 'Nedklocka Processorhastighet',
|
||||
REMOTE_TIMEOUT: 'Remote timeout',
|
||||
REMOTE_TIMEOUT_EN: 'Disable remote on missing roomtemperature',
|
||||
HEATINGOFF: 'Start boiler with forced heating off', // TODO translate
|
||||
MIN_DURATION: 'Time for detection shower',
|
||||
ENABLE_SHOWER_TIMER: 'Aktivera Dusch-timer',
|
||||
ENABLE_SHOWER_ALERT: 'Aktivera Dusch-varning',
|
||||
TRIGGER_TIME: 'Aktiveringstid',
|
||||
|
||||
@@ -120,7 +120,10 @@ const tr: Translation = {
|
||||
BYPASS_TOKEN: 'API bağlantılarında Erişim Jeton onaylamasını geç',
|
||||
READONLY: 'Salt okunur modu devreye al (bütün giden EMS Tx Yazma komutlarını engeller)',
|
||||
UNDERCLOCK_CPU: 'İşlemci hızını düşür',
|
||||
REMOTE_TIMEOUT: 'Remote timeout',
|
||||
REMOTE_TIMEOUT_EN: 'Disable remote on missing roomtemperature',
|
||||
HEATINGOFF: 'Start boiler with forced heating off', // TODO translate
|
||||
MIN_DURATION: 'Time for detection shower',
|
||||
ENABLE_SHOWER_TIMER: 'Duş Sayacını Devreye Al',
|
||||
ENABLE_SHOWER_ALERT: 'Duş Alarmını Devreye Al',
|
||||
TRIGGER_TIME: 'Tetikleme Zamanı',
|
||||
|
||||
@@ -507,6 +507,45 @@ const ApplicationSettings: FC = () => {
|
||||
label={LL.HEATINGOFF()}
|
||||
disabled={saving}
|
||||
/>
|
||||
<Grid
|
||||
container
|
||||
spacing={1}
|
||||
direction="row"
|
||||
justifyContent="flex-start"
|
||||
alignItems="flex-start"
|
||||
>
|
||||
<Grid item xs={12} sm={6} md={4}>
|
||||
<BlockFormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={data.remote_timeout_en}
|
||||
onChange={updateFormValue}
|
||||
name="remote_timeout_en"
|
||||
/>
|
||||
}
|
||||
label={LL.REMOTE_TIMEOUT_EN()}
|
||||
/>
|
||||
</Grid>
|
||||
{data.remote_timeout_en && (
|
||||
<Grid item xs={12} sm={6} md={4}>
|
||||
<ValidatedTextField
|
||||
fieldErrors={fieldErrors}
|
||||
name="remote_timeout"
|
||||
label={LL.REMOTE_TIMEOUT()}
|
||||
InputProps={{
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">{LL.HOURS()}</InputAdornment>
|
||||
)
|
||||
}}
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
value={numberValue(data.remote_timeout)}
|
||||
type="number"
|
||||
onChange={updateFormValue}
|
||||
/>
|
||||
</Grid>
|
||||
)}
|
||||
</Grid>
|
||||
<Grid
|
||||
container
|
||||
spacing={0}
|
||||
@@ -551,8 +590,7 @@ const ApplicationSettings: FC = () => {
|
||||
<ValidatedTextField
|
||||
fieldErrors={fieldErrors}
|
||||
name="shower_min_duration"
|
||||
// TODO translate
|
||||
label="Dp this"
|
||||
label={LL.MIN_DURATION()}
|
||||
InputProps={{
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">{LL.SECONDS()}</InputAdornment>
|
||||
|
||||
@@ -8,6 +8,8 @@ export interface Settings {
|
||||
syslog_host: string;
|
||||
syslog_port: number;
|
||||
boiler_heatingoff: boolean;
|
||||
remote_timeout_en: boolean;
|
||||
remote_timeout: number;
|
||||
shower_timer: boolean;
|
||||
shower_alert: boolean;
|
||||
shower_alert_coldshot: number;
|
||||
|
||||
@@ -238,9 +238,9 @@ export const createSettingsValidator = (settings: Settings) =>
|
||||
shower_min_duration: [
|
||||
{
|
||||
type: 'number',
|
||||
min: 1,
|
||||
max: 3000,
|
||||
message: 'Time must be between 1 and 3000 seconds'
|
||||
min: 10,
|
||||
max: 360,
|
||||
message: 'Time must be between 10 and 360 seconds'
|
||||
}
|
||||
]
|
||||
}),
|
||||
@@ -261,6 +261,16 @@ export const createSettingsValidator = (settings: Settings) =>
|
||||
message: 'Time must be between 1 and 10 seconds'
|
||||
}
|
||||
]
|
||||
}),
|
||||
...(settings.remote_timeout_en && {
|
||||
remote_timeout: [
|
||||
{
|
||||
type: 'number',
|
||||
min: 1,
|
||||
max: 240,
|
||||
message: 'Timeout must be between 1 and 240 hours'
|
||||
}
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
@@ -65,6 +65,14 @@
|
||||
#define EMSESP_DEFAULT_BOILER_HEATINGOFF false
|
||||
#endif
|
||||
|
||||
#ifndef EMSESP_DEFAULT_REMOTE_TIMEOUT
|
||||
#define EMSESP_DEFAULT_REMOTE_TIMEOUT 24
|
||||
#endif
|
||||
|
||||
#ifndef EMSESP_DEFAULT_REMOTE_TIMEOUT_EN
|
||||
#define EMSESP_DEFAULT_REMOTE_TIMEOUT_EN false
|
||||
#endif
|
||||
|
||||
#ifndef EMSESP_DEFAULT_SHOWER_TIMER
|
||||
#define EMSESP_DEFAULT_SHOWER_TIMER false
|
||||
#endif
|
||||
|
||||
@@ -28,10 +28,14 @@ int16_t Roomctrl::remotetemp_[HCS] = {EMS_VALUE_INT16_NOTSET, EMS_VALUE_INT16
|
||||
uint8_t Roomctrl::remotehum_[HCS] = {EMS_VALUE_UINT8_NOTSET, EMS_VALUE_UINT8_NOTSET, EMS_VALUE_UINT8_NOTSET, EMS_VALUE_UINT8_NOTSET};
|
||||
uint8_t Roomctrl::sendtype_[HCS] = {SendType::TEMP, SendType::TEMP, SendType::TEMP, SendType::TEMP};
|
||||
uint8_t Roomctrl::type_[HCS] = {RemoteType::NONE, RemoteType::NONE, RemoteType::NONE, RemoteType::NONE};
|
||||
uint32_t Roomctrl::timeout_ = 0;
|
||||
|
||||
/**
|
||||
* set the temperature,
|
||||
*/
|
||||
void Roomctrl::set_timeout(uint8_t t) {
|
||||
timeout_ = t * 3600;
|
||||
}
|
||||
void Roomctrl::set_remotetemp(const uint8_t type, const uint8_t hc, const int16_t temp) {
|
||||
if (!type_[hc] && !type) {
|
||||
return;
|
||||
@@ -96,7 +100,7 @@ void Roomctrl::send(uint8_t addr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!switch_off_[hc] && (uuid::get_uptime() - receive_time_[hc]) > TIMEOUT) {
|
||||
if (!switch_off_[hc] && timeout_ && (uuid::get_uptime() - receive_time_[hc]) > timeout_) {
|
||||
remotetemp_[hc] = EMS_VALUE_INT16_NOTSET;
|
||||
switch_off_[hc] = true;
|
||||
sendtype_[hc] = SendType::TEMP;
|
||||
@@ -366,6 +370,7 @@ void Roomctrl::ack_write() {
|
||||
data[0] = TxService::TX_WRITE_SUCCESS;
|
||||
EMSuart::transmit(data, 1);
|
||||
}
|
||||
|
||||
void Roomctrl::replyF7(uint8_t addr, uint8_t dst, uint8_t offset, uint8_t typehh, uint8_t typeh, uint8_t typel, uint8_t hc) {
|
||||
uint8_t data[12];
|
||||
data[0] = addr | EMSbus::ems_mask();
|
||||
|
||||
@@ -34,6 +34,7 @@ class Roomctrl {
|
||||
static bool is_remote(const uint8_t hc) {
|
||||
return (hc < 4 && remotetemp_[hc] != EMS_VALUE_INT16_NOTSET);
|
||||
}
|
||||
static void set_timeout(uint8_t t);
|
||||
|
||||
private:
|
||||
static constexpr uint32_t SEND_INTERVAL = 15000; // 15 sec
|
||||
@@ -59,6 +60,7 @@ class Roomctrl {
|
||||
static uint8_t remotehum_[HCS];
|
||||
static uint8_t sendtype_[HCS];
|
||||
static uint8_t type_[HCS]; // type is product-id 113 for RC20 or 109 for Junkers FB10
|
||||
static uint32_t timeout_;
|
||||
};
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define EMSESP_APP_VERSION "3.7.0-test.15"
|
||||
#define EMSESP_APP_VERSION "3.7.0-test.16"
|
||||
|
||||
@@ -43,6 +43,8 @@ void WebSettings::read(WebSettings & settings, JsonObject root) {
|
||||
root["syslog_host"] = settings.syslog_host;
|
||||
root["syslog_port"] = settings.syslog_port;
|
||||
root["boiler_heatingoff"] = settings.boiler_heatingoff;
|
||||
root["remote_timeout"] = settings.remote_timeout;
|
||||
root["remote_timeout_en"] = settings.remote_timeout_enabled;
|
||||
root["shower_timer"] = settings.shower_timer;
|
||||
root["shower_alert"] = settings.shower_alert;
|
||||
root["shower_alert_coldshot"] = settings.shower_alert_coldshot;
|
||||
@@ -238,7 +240,7 @@ StateUpdateResult WebSettings::update(JsonObject root, WebSettings & settings) {
|
||||
prev = settings.shower_alert_trigger;
|
||||
settings.shower_alert_trigger = root["shower_alert_trigger"] | EMSESP_DEFAULT_SHOWER_ALERT_TRIGGER;
|
||||
check_flag(prev, settings.shower_alert_trigger, ChangeFlags::SHOWER);
|
||||
prev = settings.shower_min_duration;
|
||||
prev = settings.shower_min_duration;
|
||||
settings.shower_min_duration = root["shower_min_duration"] | EMSESP_DEFAULT_SHOWER_MIN_DURATION;
|
||||
check_flag(prev, settings.shower_min_duration, ChangeFlags::SHOWER);
|
||||
prev = settings.shower_alert_coldshot;
|
||||
@@ -300,9 +302,12 @@ StateUpdateResult WebSettings::update(JsonObject root, WebSettings & settings) {
|
||||
settings.trace_raw = root["trace_raw"] | EMSESP_DEFAULT_TRACELOG_RAW;
|
||||
EMSESP::trace_raw(settings.trace_raw);
|
||||
|
||||
settings.notoken_api = root["notoken_api"] | EMSESP_DEFAULT_NOTOKEN_API;
|
||||
settings.solar_maxflow = root["solar_maxflow"] | EMSESP_DEFAULT_SOLAR_MAXFLOW;
|
||||
settings.boiler_heatingoff = root["boiler_heatingoff"] | EMSESP_DEFAULT_BOILER_HEATINGOFF;
|
||||
settings.notoken_api = root["notoken_api"] | EMSESP_DEFAULT_NOTOKEN_API;
|
||||
settings.solar_maxflow = root["solar_maxflow"] | EMSESP_DEFAULT_SOLAR_MAXFLOW;
|
||||
settings.boiler_heatingoff = root["boiler_heatingoff"] | EMSESP_DEFAULT_BOILER_HEATINGOFF;
|
||||
settings.remote_timeout = root["remote_timeout"] | EMSESP_DEFAULT_REMOTE_TIMEOUT;
|
||||
settings.remote_timeout_enabled = root["remote_timeout_en"] | EMSESP_DEFAULT_REMOTE_TIMEOUT_EN;
|
||||
emsesp::Roomctrl::set_timeout(settings.remote_timeout_enabled ? settings.remote_timeout : 0);
|
||||
|
||||
settings.fahrenheit = root["fahrenheit"];
|
||||
EMSESP::system_.fahrenheit(settings.fahrenheit);
|
||||
|
||||
@@ -34,11 +34,13 @@ class WebSettings {
|
||||
uint8_t tx_mode;
|
||||
uint8_t ems_bus_id;
|
||||
bool boiler_heatingoff;
|
||||
uint8_t remote_timeout;
|
||||
bool remote_timeout_enabled;
|
||||
bool shower_timer;
|
||||
bool shower_alert;
|
||||
uint8_t shower_alert_trigger; // minutes
|
||||
uint8_t shower_alert_trigger; // minutes
|
||||
uint8_t shower_alert_coldshot; // seconds
|
||||
uint32_t shower_min_duration; // seconds
|
||||
uint32_t shower_min_duration; // seconds
|
||||
bool syslog_enabled;
|
||||
int8_t syslog_level; // uuid::log::Level
|
||||
uint32_t syslog_mark_interval;
|
||||
|
||||
Reference in New Issue
Block a user