1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-03 08:31:47 +00:00

Compare commits

...

10 Commits

Author SHA1 Message Date
Jesse Hills
40523e6823 Merge pull request #5465 from esphome/bump-2023.9.2
2023.9.2
2023-10-02 21:24:01 +13:00
Jesse Hills
5e1472185c Bump version to 2023.9.2 2023-10-02 17:01:22 +13:00
Jesse Hills
af005a6554 Ensure esphome directory exists on addon startup (#5464) 2023-10-02 17:01:22 +13:00
Angel Nunez Mencias
efd31be21c Fix SPI support for second bus on 2023.9.1 (#5456) 2023-10-02 17:01:22 +13:00
Avri Chen-Roth
e9bda2810f Fix an Issue with IR Remote Climate and Whirlpool protocol toggle (#5447)
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-10-02 17:01:22 +13:00
Clyde Stubbs
ec4777b8d0 SPI fixes for buggy components (#5446) 2023-10-02 17:01:22 +13:00
Jesse Hills
9b75121337 Merge pull request #5442 from esphome/bump-2023.9.1
2023.9.1
2023-09-28 13:05:04 +13:00
Jesse Hills
d262548d2e Bump version to 2023.9.1 2023-09-28 11:52:35 +13:00
Jesse Hills
b5b654e054 Migrate dashboard json files to /data folder instead of wiping out (#5441) 2023-09-28 11:52:35 +13:00
Marc J
dae8ab563c Tuya Number Scaling by step value (#5108) 2023-09-28 11:52:35 +13:00
9 changed files with 26 additions and 11 deletions

View File

@@ -270,7 +270,7 @@ esphome/components/sn74hc165/* @jesserockz
esphome/components/socket/* @esphome/core
esphome/components/sonoff_d1/* @anatoly-savchenkov
esphome/components/speaker/* @jesserockz
esphome/components/spi/* @esphome/core
esphome/components/spi/* @clydebarrow @esphome/core
esphome/components/spi_device/* @clydebarrow
esphome/components/spi_led_strip/* @clydebarrow
esphome/components/sprinkler/* @kbx81

View File

@@ -41,8 +41,15 @@ fi
mkdir -p "${pio_cache_base}"
mkdir -p /config/esphome
if bashio::fs.directory_exists '/config/esphome/.esphome'; then
bashio::log.info "Removing old .esphome directory..."
bashio::log.info "Migrating old .esphome directory..."
if bashio::fs.file_exists '/config/esphome/.esphome/esphome.json'; then
mv /config/esphome/.esphome/esphome.json /data/esphome.json
fi
mkdir -p "/data/storage"
mv /config/esphome/.esphome/*.json /data/storage/ || true
rm -rf /config/esphome/.esphome
fi

View File

@@ -217,10 +217,7 @@ uint8_t MAX7219Component::printf(const char *format, ...) {
return 0;
}
void MAX7219Component::set_writer(max7219_writer_t &&writer) { this->writer_ = writer; }
void MAX7219Component::set_intensity(uint8_t intensity) {
this->intensity_ = intensity;
this->send_to_all_(MAX7219_REGISTER_INTENSITY, this->intensity_);
}
void MAX7219Component::set_intensity(uint8_t intensity) { this->intensity_ = intensity; }
void MAX7219Component::set_num_chips(uint8_t num_chips) { this->num_chips_ = num_chips; }
uint8_t MAX7219Component::strftime(uint8_t pos, const char *format, ESPTime time) {

View File

@@ -28,7 +28,7 @@ from esphome.const import (
)
from esphome.core import coroutine_with_priority, CORE
CODEOWNERS = ["@esphome/core"]
CODEOWNERS = ["@esphome/core", "@clydebarrow"]
spi_ns = cg.esphome_ns.namespace("spi")
SPIComponent = spi_ns.class_("SPIComponent", cg.Component)
SPIDevice = spi_ns.class_("SPIDevice")
@@ -187,7 +187,7 @@ def get_spi_interface(index):
# Following code can't apply to C2, H2 or 8266 since they have only one SPI
if get_target_variant() in (VARIANT_ESP32S3, VARIANT_ESP32S2):
return "new SPIClass(FSPI)"
return "return new SPIClass(HSPI)"
return "new SPIClass(HSPI)"
SPI_SCHEMA = cv.All(

View File

@@ -248,6 +248,7 @@ class SPIDelegateDummy : public SPIDelegate {
SPIDelegateDummy() = default;
uint8_t transfer(uint8_t data) override { return 0; }
void end_transaction() override{};
void begin_transaction() override;
};

View File

@@ -10,7 +10,7 @@ void TuyaNumber::setup() {
this->parent_->register_listener(this->number_id_, [this](const TuyaDatapoint &datapoint) {
if (datapoint.type == TuyaDatapointType::INTEGER) {
ESP_LOGV(TAG, "MCU reported number %u is: %d", datapoint.id, datapoint.value_int);
this->publish_state(datapoint.value_int);
this->publish_state(datapoint.value_int * this->traits.get_step());
} else if (datapoint.type == TuyaDatapointType::ENUM) {
ESP_LOGV(TAG, "MCU reported number %u is: %u", datapoint.id, datapoint.value_enum);
this->publish_state(datapoint.value_enum);
@@ -22,7 +22,8 @@ void TuyaNumber::setup() {
void TuyaNumber::control(float value) {
ESP_LOGV(TAG, "Setting number %u: %f", this->number_id_, value);
if (this->type_ == TuyaDatapointType::INTEGER) {
this->parent_->set_integer_datapoint_value(this->number_id_, value);
int integer_value = lround(value / this->traits.get_step());
this->parent_->set_integer_datapoint_value(this->number_id_, integer_value);
} else if (this->type_ == TuyaDatapointType::ENUM) {
this->parent_->set_enum_datapoint_value(this->number_id_, value);
}

View File

@@ -33,6 +33,7 @@ const uint8_t WHIRLPOOL_SWING_MASK = 128;
const uint8_t WHIRLPOOL_POWER = 0x04;
void WhirlpoolClimate::transmit_state() {
this->last_transmit_time_ = millis(); // setting the time of the last transmission.
uint8_t remote_state[WHIRLPOOL_STATE_LENGTH] = {0};
remote_state[0] = 0x83;
remote_state[1] = 0x06;
@@ -149,6 +150,12 @@ void WhirlpoolClimate::transmit_state() {
}
bool WhirlpoolClimate::on_receive(remote_base::RemoteReceiveData data) {
// Check if the esp isn't currently transmitting.
if (millis() - this->last_transmit_time_ < 500) {
ESP_LOGV(TAG, "Blocked receive because of current trasmittion");
return false;
}
// Validate header
if (!data.expect_item(WHIRLPOOL_HEADER_MARK, WHIRLPOOL_HEADER_SPACE)) {
ESP_LOGV(TAG, "Header fail");

View File

@@ -47,6 +47,8 @@ class WhirlpoolClimate : public climate_ir::ClimateIR {
void transmit_state() override;
/// Handle received IR Buffer
bool on_receive(remote_base::RemoteReceiveData data) override;
/// Set the time of the last transmission.
int32_t last_transmit_time_{};
bool send_swing_cmd_{false};
Model model_;

View File

@@ -1,6 +1,6 @@
"""Constants used by esphome."""
__version__ = "2023.9.0"
__version__ = "2023.9.2"
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
VALID_SUBSTITUTIONS_CHARACTERS = (