mirror of
https://github.com/esphome/esphome.git
synced 2025-01-19 12:24:05 +00:00
commit
e4b2de5c68
@ -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])
|
||||
|
@ -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"
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -1,6 +1,6 @@
|
||||
"""Constants used by esphome."""
|
||||
|
||||
__version__ = "2023.3.1"
|
||||
__version__ = "2023.3.2"
|
||||
|
||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||
|
||||
|
@ -547,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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user