mirror of
				https://github.com/esphome/esphome.git
				synced 2025-11-03 08:31:47 +00:00 
			
		
		
		
	Compare commits
	
		
			10 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					40523e6823 | ||
| 
						 | 
					5e1472185c | ||
| 
						 | 
					af005a6554 | ||
| 
						 | 
					efd31be21c | ||
| 
						 | 
					e9bda2810f | ||
| 
						 | 
					ec4777b8d0 | ||
| 
						 | 
					9b75121337 | ||
| 
						 | 
					d262548d2e | ||
| 
						 | 
					b5b654e054 | ||
| 
						 | 
					dae8ab563c | 
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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) {
 | 
			
		||||
 
 | 
			
		||||
@@ -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(
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -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");
 | 
			
		||||
 
 | 
			
		||||
@@ -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_;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
"""Constants used by esphome."""
 | 
			
		||||
 | 
			
		||||
__version__ = "2023.9.0"
 | 
			
		||||
__version__ = "2023.9.2"
 | 
			
		||||
 | 
			
		||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
 | 
			
		||||
VALID_SUBSTITUTIONS_CHARACTERS = (
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user