1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-01 15:41:52 +00:00

Compare commits

...

10 Commits

Author SHA1 Message Date
Jesse Hills
e4b2de5c68 Merge pull request #4623 from esphome/bump-2023.3.2
2023.3.2
2023-03-27 16:45:14 +13:00
Jesse Hills
f862b479e7 Bump version to 2023.3.2 2023-03-27 15:58:29 +13:00
tracestep
358c59bd8d SX1509 minimum loop period (fixes esphome/issues#4325) (#4613)
* Minimum loop period (fixes esphome/issues#4325)

* clang-tidy suggestions

* More clang-tidy suggestions
2023-03-27 15:58:28 +13:00
guillempages
74fe135c9c Fix animation resizing (#4608)
Animation resizing in RGB24 format is causing an error "Image cannot be resized to a bigger size". Other image types do not show the issue, and the only difference is the "image.thumbnail" call.

Removed the call and tested; the animation is shown with the desired size.
2023-03-27 15:58:28 +13:00
Jesse Hills
8d3896172d Swap curly brackets for round on LockGuard (#4610) 2023-03-27 15:58:28 +13:00
Kai Gerken
9d9725144d Fix compile error on pzemdc.h (#4583) 2023-03-27 15:58:28 +13:00
Jesse Hills
dd8dc1ef1d Merge pull request #4609 from esphome/bump-2023.3.1
2023.3.1
2023-03-22 12:40:28 +13:00
Jesse Hills
bc427de16a Bump version to 2023.3.1 2023-03-22 12:03:34 +13:00
Jesse Hills
db5988bbe1 rp2040: Use fake Mutex lock (#4602) 2023-03-22 12:03:34 +13:00
Nathaniel Wesley Filardo
a3875af4b4 climate: brown paper bag fix for on_configure (#4573)
I forgot this hunk in https://github.com/esphome/esphome/pull/4511 .
I'm sorry for the noise.
2023-03-22 12:03:34 +13:00
8 changed files with 16 additions and 10 deletions

View File

@@ -76,8 +76,6 @@ async def to_code(config):
pos = 0
for frameIndex in range(frames):
image.seek(frameIndex)
if CONF_RESIZE in config:
image.thumbnail(config[CONF_RESIZE])
frame = image.convert("RGB")
if CONF_RESIZE in config:
frame = frame.resize([width, height])

View File

@@ -324,6 +324,10 @@ async def setup_climate_core_(var, config):
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
await automation.build_automation(trigger, [], conf)
for conf in config.get(CONF_ON_CONTROL, []):
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
await automation.build_automation(trigger, [], conf)
async def register_climate(var, config):
if not CORE.has_id(config[CONF_ID]):

View File

@@ -1,5 +1,6 @@
#pragma once
#include "esphome/core/automation.h"
#include "esphome/core/component.h"
#include "esphome/components/sensor/sensor.h"
#include "esphome/components/modbus/modbus.h"

View File

@@ -42,6 +42,9 @@ void SX1509Component::dump_config() {
void SX1509Component::loop() {
if (this->has_keypad_) {
if (millis() - this->last_loop_timestamp_ < min_loop_period_)
return;
this->last_loop_timestamp_ = millis();
uint16_t key_data = this->read_key_data();
for (auto *binary_sensor : this->keypad_binary_sensors_)
binary_sensor->process(key_data);

View File

@@ -69,6 +69,9 @@ class SX1509Component : public Component, public i2c::I2CDevice {
uint8_t debounce_time_ = 1;
std::vector<SX1509Processor *> keypad_binary_sensors_;
uint32_t last_loop_timestamp_ = 0;
const uint32_t min_loop_period_ = 15; // ms
void setup_keypad_();
void set_debounce_config_(uint8_t config_value);
void set_debounce_time_(uint8_t time);

View File

@@ -1,6 +1,6 @@
"""Constants used by esphome."""
__version__ = "2023.3.0"
__version__ = "2023.3.2"
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"

View File

@@ -393,13 +393,13 @@ void hsv_to_rgb(int hue, float saturation, float value, float &red, float &green
}
// System APIs
#if defined(USE_ESP8266)
#if defined(USE_ESP8266) || defined(USE_RP2040)
// ESP8266 doesn't have mutexes, but that shouldn't be an issue as it's single-core and non-preemptive OS.
Mutex::Mutex() {}
void Mutex::lock() {}
bool Mutex::try_lock() { return true; }
void Mutex::unlock() {}
#elif defined(USE_ESP32) || defined(USE_RP2040)
#elif defined(USE_ESP32)
Mutex::Mutex() { handle_ = xSemaphoreCreateMutex(); }
void Mutex::lock() { xSemaphoreTake(this->handle_, portMAX_DELAY); }
bool Mutex::try_lock() { return xSemaphoreTake(this->handle_, 0) == pdTRUE; }

View File

@@ -17,9 +17,6 @@
#if defined(USE_ESP32)
#include <freertos/FreeRTOS.h>
#include <freertos/semphr.h>
#elif defined(USE_RP2040)
#include <FreeRTOS.h>
#include <semphr.h>
#endif
#define HOT __attribute__((hot))
@@ -539,7 +536,7 @@ class Mutex {
Mutex &operator=(const Mutex &) = delete;
private:
#if defined(USE_ESP32) || defined(USE_RP2040)
#if defined(USE_ESP32)
SemaphoreHandle_t handle_;
#endif
};
@@ -550,7 +547,7 @@ class Mutex {
*/
class LockGuard {
public:
LockGuard(Mutex &mutex) : mutex_{mutex} { mutex_.lock(); }
LockGuard(Mutex &mutex) : mutex_(mutex) { mutex_.lock(); }
~LockGuard() { mutex_.unlock(); }
private: