mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 01:09:51 +03:00
@@ -297,7 +297,7 @@ const SchedulerDialog = ({
|
|||||||
name="time"
|
name="time"
|
||||||
label={isCondition ? 'Condition' : 'On Change Value'}
|
label={isCondition ? 'Condition' : 'On Change Value'}
|
||||||
fullWidth
|
fullWidth
|
||||||
value={editItem.time == "00:00" ? editItem.time = "" : editItem.time}
|
value={editItem.time == '00:00' ? (editItem.time = '') : editItem.time}
|
||||||
margin="normal"
|
margin="normal"
|
||||||
onChange={updateFormValue}
|
onChange={updateFormValue}
|
||||||
/>
|
/>
|
||||||
@@ -307,7 +307,9 @@ const SchedulerDialog = ({
|
|||||||
name="time"
|
name="time"
|
||||||
type="time"
|
type="time"
|
||||||
label={isTimer ? LL.TIMER(1) : LL.TIME(1)}
|
label={isTimer ? LL.TIMER(1) : LL.TIME(1)}
|
||||||
value={editItem.time == "" ? editItem.time = "00:00" : editItem.time}
|
value={
|
||||||
|
editItem.time == '' ? (editItem.time = '00:00') : editItem.time
|
||||||
|
}
|
||||||
margin="normal"
|
margin="normal"
|
||||||
onChange={updateFormValue}
|
onChange={updateFormValue}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ class Roomctrl {
|
|||||||
static void set_timeout(uint8_t t);
|
static void set_timeout(uint8_t t);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr uint32_t SEND_INTERVAL = 15000; // 15 sec
|
static constexpr uint32_t SEND_INTERVAL = 15000; // 15 sec
|
||||||
static constexpr uint8_t HCS = 4; // max 4 heating circuits
|
static constexpr uint8_t HCS = 4; // max 4 heating circuits
|
||||||
enum SendType : uint8_t { TEMP, HUMI };
|
enum SendType : uint8_t { TEMP, HUMI };
|
||||||
|
|
||||||
static uint8_t get_hc(const uint8_t addr);
|
static uint8_t get_hc(const uint8_t addr);
|
||||||
|
|||||||
@@ -100,12 +100,12 @@ void Shower::loop() {
|
|||||||
// it is over the wait period, so assume that the shower has finished and calculate the total time and publish
|
// it is over the wait period, so assume that the shower has finished and calculate the total time and publish
|
||||||
// because its unsigned long, can't have negative so check if length is less than OFFSET_TIME
|
// because its unsigned long, can't have negative so check if length is less than OFFSET_TIME
|
||||||
if ((timer_pause_ - timer_start_) > SHOWER_OFFSET_TIME) {
|
if ((timer_pause_ - timer_start_) > SHOWER_OFFSET_TIME) {
|
||||||
duration_ = (timer_pause_ - timer_start_ - SHOWER_OFFSET_TIME);
|
duration_ = (timer_pause_ - timer_start_ - SHOWER_OFFSET_TIME); // duration in seconds
|
||||||
if (duration_ > shower_min_duration_) {
|
if (duration_ > shower_min_duration_) {
|
||||||
JsonDocument doc;
|
JsonDocument doc;
|
||||||
|
|
||||||
// duration in seconds
|
// duration in seconds
|
||||||
doc["duration"] = (duration_ / 1000UL); // seconds
|
doc["duration"] = duration_; // seconds
|
||||||
time_t now = time(nullptr);
|
time_t now = time(nullptr);
|
||||||
// if NTP enabled, publish timestamp
|
// if NTP enabled, publish timestamp
|
||||||
if (now > 1576800000) { // year 2020
|
if (now > 1576800000) { // year 2020
|
||||||
@@ -114,9 +114,9 @@ void Shower::loop() {
|
|||||||
char dt[25];
|
char dt[25];
|
||||||
strftime(dt, sizeof(dt), "%FT%T%z", tm_);
|
strftime(dt, sizeof(dt), "%FT%T%z", tm_);
|
||||||
doc["timestamp"] = dt;
|
doc["timestamp"] = dt;
|
||||||
LOG_INFO("shower finished %s (duration %lu s)", dt, duration_ / 1000UL);
|
LOG_INFO("shower finished %s (duration %lu s)", dt, duration_);
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("shower finished (duration %lu s)", duration_ / 1000UL);
|
LOG_INFO("shower finished (duration %lu s)", duration_);
|
||||||
}
|
}
|
||||||
Mqtt::queue_publish("shower_data", doc.as<JsonObject>());
|
Mqtt::queue_publish("shower_data", doc.as<JsonObject>());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,14 @@ GET {{host}}/api/temperaturesensor/info
|
|||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
|
GET {{host}}/rest/deviceData?id=3
|
||||||
|
Content-Type: application/json
|
||||||
|
Authorization: Bearer {{token}}
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
GET {{host}}/api/boiler/commands
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test on dev
|
# Test on dev
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user