mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-26 08:39:09 +03:00
Merge pull request #2911 from MichaelDvP/dev
day schedule defaults to all days, allow gpio 1,3 for custom #2908
This commit is contained in:
@@ -8,6 +8,7 @@ For more details go to [emsesp.org](https://emsesp.org/).
|
|||||||
|
|
||||||
- update time saved in nvs
|
- update time saved in nvs
|
||||||
- heatpump entities [#2883](https://github.com/emsesp/EMS-ESP32/issues/2883)
|
- heatpump entities [#2883](https://github.com/emsesp/EMS-ESP32/issues/2883)
|
||||||
|
- HA number mode selectable box/slider (slider for max range 100) [#2900](https://github.com/emsesp/EMS-ESP32/discussions/2900)
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|
||||||
@@ -25,3 +26,6 @@ For more details go to [emsesp.org](https://emsesp.org/).
|
|||||||
- GPIOs stored along with the name and reported in log if conflicting
|
- GPIOs stored along with the name and reported in log if conflicting
|
||||||
- free GPIOs depend on board profile [#2901](https://github.com/emsesp/EMS-ESP32/issues/2901)
|
- free GPIOs depend on board profile [#2901](https://github.com/emsesp/EMS-ESP32/issues/2901)
|
||||||
- prefer PSram for mqtt queue [#2889](https://github.com/emsesp/EMS-ESP32/issues/2889)
|
- prefer PSram for mqtt queue [#2889](https://github.com/emsesp/EMS-ESP32/issues/2889)
|
||||||
|
- day schedule defult to all days, no day selected is not allowed
|
||||||
|
- board profile `CUSTOM` can only be selected in developer mode
|
||||||
|
- mqtt sends round values without decimals (`28` instead of `28.0`)
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ const MIN_ID = -100;
|
|||||||
const MAX_ID = 100;
|
const MAX_ID = 100;
|
||||||
const ICON_SIZE = 16;
|
const ICON_SIZE = 16;
|
||||||
const SCHEDULE_FLAG_THRESHOLD = 127;
|
const SCHEDULE_FLAG_THRESHOLD = 127;
|
||||||
|
const FLAG_ALL_DAYS = 127;
|
||||||
const REFERENCE_YEAR = 2017;
|
const REFERENCE_YEAR = 2017;
|
||||||
const REFERENCE_MONTH = '01';
|
const REFERENCE_MONTH = '01';
|
||||||
const LOG_2 = Math.log(2);
|
const LOG_2 = Math.log(2);
|
||||||
@@ -51,7 +52,7 @@ const WEEK_DAYS = [1, 2, 3, 4, 5, 6, 7] as const;
|
|||||||
const DEFAULT_SCHEDULE_ITEM: Omit<ScheduleItem, 'id' | 'o_id'> = {
|
const DEFAULT_SCHEDULE_ITEM: Omit<ScheduleItem, 'id' | 'o_id'> = {
|
||||||
active: false,
|
active: false,
|
||||||
deleted: false,
|
deleted: false,
|
||||||
flags: ScheduleFlag.SCHEDULE_DAY,
|
flags: FLAG_ALL_DAYS,
|
||||||
time: '',
|
time: '',
|
||||||
cmd: '',
|
cmd: '',
|
||||||
value: '',
|
value: '',
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ import type { ScheduleItem } from './types';
|
|||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
const FLAG_MASK_127 = 127;
|
const FLAG_MASK_127 = 127;
|
||||||
const SCHEDULE_TYPE_THRESHOLD = 128;
|
const SCHEDULE_TYPE_THRESHOLD = 127;
|
||||||
|
const FLAG_ALL_DAYS = 127;
|
||||||
const DEFAULT_TIME = '00:00';
|
const DEFAULT_TIME = '00:00';
|
||||||
const TYPOGRAPHY_FONT_SIZE = 10;
|
const TYPOGRAPHY_FONT_SIZE = 10;
|
||||||
|
|
||||||
@@ -104,7 +105,7 @@ const SchedulerDialog = ({
|
|||||||
// 130 is on condition
|
// 130 is on condition
|
||||||
// 132 is immediate
|
// 132 is immediate
|
||||||
setScheduleType(
|
setScheduleType(
|
||||||
selectedItem.flags < SCHEDULE_TYPE_THRESHOLD
|
selectedItem.flags <= SCHEDULE_TYPE_THRESHOLD
|
||||||
? ScheduleFlag.SCHEDULE_DAY
|
? ScheduleFlag.SCHEDULE_DAY
|
||||||
: selectedItem.flags
|
: selectedItem.flags
|
||||||
);
|
);
|
||||||
@@ -181,7 +182,7 @@ const SchedulerDialog = ({
|
|||||||
setScheduleType(flag);
|
setScheduleType(flag);
|
||||||
// wipe the time field when changing the schedule type
|
// wipe the time field when changing the schedule type
|
||||||
// set the flags based on type
|
// set the flags based on type
|
||||||
const newFlags = flag === ScheduleFlag.SCHEDULE_DAY ? 0 : flag;
|
const newFlags = flag === ScheduleFlag.SCHEDULE_DAY ? FLAG_ALL_DAYS : flag;
|
||||||
setEditItem((prev) => ({ ...prev, time: '', flags: newFlags }));
|
setEditItem((prev) => ({ ...prev, time: '', flags: newFlags }));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -190,7 +191,7 @@ const SchedulerDialog = ({
|
|||||||
|
|
||||||
const handleDOWChange = useCallback(
|
const handleDOWChange = useCallback(
|
||||||
(_event: React.SyntheticEvent<HTMLElement>, flags: string[]) => {
|
(_event: React.SyntheticEvent<HTMLElement>, flags: string[]) => {
|
||||||
const newFlags = getFlagDOWnumber(flags);
|
const newFlags = getFlagDOWnumber(flags) === 0 ? FLAG_ALL_DAYS : getFlagDOWnumber(flags);
|
||||||
setEditItem((prev) => ({ ...prev, flags: newFlags }));
|
setEditItem((prev) => ({ ...prev, flags: newFlags }));
|
||||||
},
|
},
|
||||||
[getFlagDOWnumber]
|
[getFlagDOWnumber]
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
#define EMSESP_APP_VERSION "3.8.1-dev.6"
|
#define EMSESP_APP_VERSION "3.8.1-dev.7"
|
||||||
|
|||||||
@@ -141,11 +141,6 @@ StateUpdateResult WebSettings::update(JsonObject root, WebSettings & settings) {
|
|||||||
EMSESP::system_.remove_gpio(17, true); // ETH.clock output
|
EMSESP::system_.remove_gpio(17, true); // ETH.clock output
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if CONFIG_IDF_TARGET_ESP32
|
|
||||||
// Uart0 pins not allowed for all other gpio
|
|
||||||
EMSESP::system_.remove_gpio(1, true);
|
|
||||||
EMSESP::system_.remove_gpio(3, true);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// free old gpios from used list to allow remapping
|
// free old gpios from used list to allow remapping
|
||||||
EMSESP::system_.remove_gpio(original_settings.led_gpio);
|
EMSESP::system_.remove_gpio(original_settings.led_gpio);
|
||||||
|
|||||||
Reference in New Issue
Block a user