Update changelogs

This commit is contained in:
Theo Arends 2024-10-06 22:40:28 +02:00
parent efce07086c
commit 4196f753c8
3 changed files with 43 additions and 15 deletions

View File

@ -15,7 +15,7 @@ All notable changes to this project will be documented in this file.
### Changed
- ESP32 platform update from 2024.09.10 to 2024.09.30 and Framework (Arduino Core) from v3.0.5 to v3.1.0.240926 (#22203)
- Berry improve `persist` dirty data handling
- Berry improve `persist` dirty data handling (#22246)
### Fixed
- ESP32 Range Extender compile error with core 3.0.0 (#22205)

View File

@ -178,6 +178,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- Berry avoid `readbytes()` from crashing when file is too large [#22057](https://github.com/arendst/Tasmota/issues/22057)
- Berry energy missing attributes [#22116](https://github.com/arendst/Tasmota/issues/22116)
- Berry I2C to prepare M5Stack I2C STM32 based devices [#22143](https://github.com/arendst/Tasmota/issues/22143)
- Berry improve `persist` dirty data handling [#22246](https://github.com/arendst/Tasmota/issues/22246)
- ESP32-S3 uDisplay force cache writes to RGB display [#22222](https://github.com/arendst/Tasmota/issues/22222)
- LVGL Added OpenHASP icons to font `montserrat-28` [#22048](https://github.com/arendst/Tasmota/issues/22048)
- LVGL compilation of lv_menu [#22188](https://github.com/arendst/Tasmota/issues/22188)

View File

@ -65,6 +65,8 @@ struct DALI {
uint16_t received_dali_data; // Data received from DALI bus
uint8_t pin_rx;
uint8_t pin_tx;
uint8_t address;
uint8_t command;
uint8_t dimmer;
bool power;
bool input_ready;
@ -138,6 +140,8 @@ void DaliDigitalWrite(bool pin_value) {
}
void DaliSendData(uint8_t firstByte, uint8_t secondByte) {
Dali->address = firstByte;
Dali->command = secondByte;
if (BROADCAST_DP == firstByte) {
Dali->power = (secondByte); // State
Dali->dimmer = secondByte; // Value
@ -184,25 +188,31 @@ void DaliPower(uint8_t val) {
/***********************************************************/
void ResponseAppendDali(void) {
ResponseAppend_P(PSTR("\"" D_NAME_DALI "\":{\"Power\":\"%s\",\"Dimmer\":%d,\"Address\":%d,\"Command\":%d}"),
GetStateText(Dali->power), Dali->dimmer, Dali->address, Dali->command);
}
void DaliInput(void) {
if (Dali->input_ready) {
uint8_t DALIaddr = Dali->received_dali_data >> 8;
uint8_t DALIcmnd = Dali->received_dali_data;
if (BROADCAST_DP == DALIaddr) {
Dali->power = (DALIcmnd); // State
Dali->dimmer = DALIcmnd; // Value
Dali->address = Dali->received_dali_data >> 8;
Dali->command = Dali->received_dali_data;
if (BROADCAST_DP == Dali->address) {
Dali->power = (Dali->command); // State
Dali->dimmer = Dali->command; // Value
}
// AddLog(LOG_LEVEL_DEBUG, PSTR("DLI: Received 0x%04X"), Dali->received_dali_data);
Response_P(PSTR("{\"" D_NAME_DALI "\":{\"Power\":\"%s\",\"Dimmer\":%d,\"Address\":%d,\"Command\":%d}}"),
GetStateText(Dali->power), Dali->dimmer, DALIaddr, DALIcmnd);
Response_P(PSTR("{"));
ResponseAppendDali();
ResponseJsonEnd();
MqttPublishPrefixTopicRulesProcess_P(RESULT_OR_TELE, PSTR(D_NAME_DALI));
Dali->input_ready = false;
}
}
void DaliPreInit(void) {
void DaliInit(void) {
if (!PinUsed(GPIO_DALI_TX) || !PinUsed(GPIO_DALI_RX)) { return; }
Dali = (DALI*)calloc(sizeof(DALI), 1);
@ -226,6 +236,10 @@ void DaliPreInit(void) {
DaliEnableRxInterrupt();
}
/*********************************************************************************************\
* Experimental - Not functioning
\*********************************************************************************************/
bool DaliMqtt(void) {
/*
XdrvMailbox.topic = topic;
@ -300,6 +314,10 @@ bool DaliMqtt(void) {
return true;
}
/*********************************************************************************************\
* Commands
\*********************************************************************************************/
bool DaliJsonParse(void) {
// {"addr":254,"cmd":100}
// {"addr":2}
@ -347,10 +365,6 @@ bool DaliJsonParse(void) {
return served;
}
/*********************************************************************************************\
* Commands
\*********************************************************************************************/
void CmndDali(void) {
if (XdrvMailbox.data_len > 0) {
if (DaliJsonParse()) {
@ -377,7 +391,12 @@ void CmndDaliDimmer(void) {
* Presentation
\*********************************************************************************************/
void DaliShow(bool json) {
if (json) {
ResponseAppend_P(PSTR(","));
ResponseAppendDali();
}
}
/*********************************************************************************************\
* Interface
@ -387,7 +406,7 @@ bool Xdrv75(uint32_t function) {
bool result = false;
if (FUNC_INIT == function) {
DaliPreInit();
DaliInit();
}
else if (Dali) {
switch (function) {
@ -397,6 +416,14 @@ bool Xdrv75(uint32_t function) {
case FUNC_MQTT_DATA:
result = DaliMqtt();
break;
case FUNC_JSON_APPEND:
DaliShow(true);
break;
#ifdef USE_WEBSERVER
case FUNC_WEB_SENSOR:
DaliShow(false);
break;
#endif // USE_WEBSERVER
case FUNC_COMMAND:
result = DecodeCommand(kDALICommands, DALICommand);
break;