mirror of
				https://github.com/esphome/esphome.git
				synced 2025-11-04 00:51:49 +00:00 
			
		
		
		
	Compare commits
	
		
			51 Commits
		
	
	
		
			2022.9.0b2
			...
			2022.9.2
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					119c3f6f46 | ||
| 
						 | 
					d2c1c7507c | ||
| 
						 | 
					efdb3d1f40 | ||
| 
						 | 
					9dbc32b85f | ||
| 
						 | 
					66226abb48 | ||
| 
						 | 
					34bef2f2ca | ||
| 
						 | 
					fdd4ca6837 | ||
| 
						 | 
					9655362f23 | ||
| 
						 | 
					130c9fad22 | ||
| 
						 | 
					3de0b601bf | ||
| 
						 | 
					91560ae4e9 | ||
| 
						 | 
					fd6135aebb | ||
| 
						 | 
					e5fe5d1249 | ||
| 
						 | 
					63b42f3608 | ||
| 
						 | 
					d56107e97f | ||
| 
						 | 
					33f296e05b | ||
| 
						 | 
					97e067a277 | ||
| 
						 | 
					5f56cf3128 | ||
| 
						 | 
					5c4e83ebdc | ||
| 
						 | 
					91f1c25fcc | ||
| 
						 | 
					47a7a239ae | ||
| 
						 | 
					fb9984e21f | ||
| 
						 | 
					041eb8f6cc | ||
| 
						 | 
					733a84df75 | ||
| 
						 | 
					acd0b50b40 | ||
| 
						 | 
					60e46d485e | ||
| 
						 | 
					5bf0c92318 | ||
| 
						 | 
					39d493c278 | ||
| 
						 | 
					d2ce62aa13 | ||
| 
						 | 
					c8eb30ef27 | ||
| 
						 | 
					31ad75d01b | ||
| 
						 | 
					aa2eb29274 | ||
| 
						 | 
					22eb4f9cb9 | ||
| 
						 | 
					3acc8e7479 | ||
| 
						 | 
					adc8c1aa38 | ||
| 
						 | 
					3a82f500d4 | ||
| 
						 | 
					7d1d4831a8 | ||
| 
						 | 
					ab86ddcf02 | ||
| 
						 | 
					bf8eddb13b | ||
| 
						 | 
					e5eaf7a3fe | ||
| 
						 | 
					50f32a3aa5 | ||
| 
						 | 
					eb878710c1 | ||
| 
						 | 
					311980e0e4 | ||
| 
						 | 
					df73170e5a | ||
| 
						 | 
					ccc13cc9e1 | ||
| 
						 | 
					020b2c05c8 | ||
| 
						 | 
					4c37c17df1 | ||
| 
						 | 
					8f67acadd8 | ||
| 
						 | 
					ca13c4c1a6 | ||
| 
						 | 
					d0c646c721 | ||
| 
						 | 
					8a055675af | 
@@ -163,7 +163,7 @@ void BME280Component::setup() {
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
  config_register &= ~0b11111100;
 | 
			
		||||
  config_register |= 0b000 << 5;  // 0.5 ms standby time
 | 
			
		||||
  config_register |= 0b101 << 5;  // 1000 ms standby time
 | 
			
		||||
  config_register |= (this->iir_filter_ & 0b111) << 2;
 | 
			
		||||
  if (!this->write_byte(BME280_REGISTER_CONFIG, config_register)) {
 | 
			
		||||
    this->mark_failed();
 | 
			
		||||
 
 | 
			
		||||
@@ -227,7 +227,18 @@ optional<ProntoData> ProntoProtocol::decode(RemoteReceiveData src) {
 | 
			
		||||
  return out;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ProntoProtocol::dump(const ProntoData &data) { ESP_LOGD(TAG, "Received Pronto: data=%s", data.data.c_str()); }
 | 
			
		||||
void ProntoProtocol::dump(const ProntoData &data) {
 | 
			
		||||
  std::string first, rest;
 | 
			
		||||
  if (data.data.size() < 230) {
 | 
			
		||||
    first = data.data;
 | 
			
		||||
  } else {
 | 
			
		||||
    first = data.data.substr(0, 229);
 | 
			
		||||
    rest = data.data.substr(230);
 | 
			
		||||
  }
 | 
			
		||||
  ESP_LOGD(TAG, "Received Pronto: data=%s", first.c_str());
 | 
			
		||||
  if (!rest.empty())
 | 
			
		||||
    ESP_LOGD(TAG, "%s", rest.c_str());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
}  // namespace remote_base
 | 
			
		||||
}  // namespace esphome
 | 
			
		||||
 
 | 
			
		||||
@@ -195,11 +195,6 @@ class SPIComponent : public Component {
 | 
			
		||||
 | 
			
		||||
  template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, uint32_t DATA_RATE>
 | 
			
		||||
  void enable(GPIOPin *cs) {
 | 
			
		||||
    if (cs != nullptr) {
 | 
			
		||||
      this->active_cs_ = cs;
 | 
			
		||||
      this->active_cs_->digital_write(false);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#ifdef USE_SPI_ARDUINO_BACKEND
 | 
			
		||||
    if (this->hw_spi_ != nullptr) {
 | 
			
		||||
      uint8_t data_mode = SPI_MODE0;
 | 
			
		||||
@@ -220,6 +215,11 @@ class SPIComponent : public Component {
 | 
			
		||||
#ifdef USE_SPI_ARDUINO_BACKEND
 | 
			
		||||
    }
 | 
			
		||||
#endif  // USE_SPI_ARDUINO_BACKEND
 | 
			
		||||
 | 
			
		||||
    if (cs != nullptr) {
 | 
			
		||||
      this->active_cs_ = cs;
 | 
			
		||||
      this->active_cs_->digital_write(false);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void disable();
 | 
			
		||||
 
 | 
			
		||||
@@ -769,7 +769,7 @@ void Sprinkler::resume() {
 | 
			
		||||
    ESP_LOGD(TAG, "Resuming valve %u with %u seconds remaining", this->paused_valve_.value_or(0),
 | 
			
		||||
             this->resume_duration_.value_or(0));
 | 
			
		||||
    this->fsm_request_(this->paused_valve_.value(), this->resume_duration_.value());
 | 
			
		||||
    this->reset_resume_();
 | 
			
		||||
    this->reset_resume();
 | 
			
		||||
  } else {
 | 
			
		||||
    ESP_LOGD(TAG, "No valve to resume!");
 | 
			
		||||
  }
 | 
			
		||||
@@ -783,6 +783,11 @@ void Sprinkler::resume_or_start_full_cycle() {
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Sprinkler::reset_resume() {
 | 
			
		||||
  this->paused_valve_.reset();
 | 
			
		||||
  this->resume_duration_.reset();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const char *Sprinkler::valve_name(const size_t valve_number) {
 | 
			
		||||
  if (this->is_a_valid_valve(valve_number)) {
 | 
			
		||||
    return this->valve_[valve_number].controller_switch->get_name().c_str();
 | 
			
		||||
@@ -1101,11 +1106,6 @@ void Sprinkler::reset_cycle_states_() {
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Sprinkler::reset_resume_() {
 | 
			
		||||
  this->paused_valve_.reset();
 | 
			
		||||
  this->resume_duration_.reset();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Sprinkler::fsm_request_(size_t requested_valve, uint32_t requested_run_duration) {
 | 
			
		||||
  this->next_req_.set_valve(requested_valve);
 | 
			
		||||
  this->next_req_.set_run_duration(requested_run_duration);
 | 
			
		||||
 
 | 
			
		||||
@@ -308,6 +308,9 @@ class Sprinkler : public Component, public EntityBase {
 | 
			
		||||
  /// if a cycle was suspended using pause(), resumes it. otherwise calls start_full_cycle()
 | 
			
		||||
  void resume_or_start_full_cycle();
 | 
			
		||||
 | 
			
		||||
  /// resets resume state
 | 
			
		||||
  void reset_resume();
 | 
			
		||||
 | 
			
		||||
  /// returns a pointer to a valve's name string object; returns nullptr if valve_number is invalid
 | 
			
		||||
  const char *valve_name(size_t valve_number);
 | 
			
		||||
 | 
			
		||||
@@ -401,9 +404,6 @@ class Sprinkler : public Component, public EntityBase {
 | 
			
		||||
  /// resets the cycle state for all valves
 | 
			
		||||
  void reset_cycle_states_();
 | 
			
		||||
 | 
			
		||||
  /// resets resume state
 | 
			
		||||
  void reset_resume_();
 | 
			
		||||
 | 
			
		||||
  /// make a request of the state machine
 | 
			
		||||
  void fsm_request_(size_t requested_valve, uint32_t requested_run_duration = 0);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -165,15 +165,19 @@ class Config(OrderedDict, fv.FinalValidateConfig):
 | 
			
		||||
                return err
 | 
			
		||||
        return None
 | 
			
		||||
 | 
			
		||||
    def get_deepest_document_range_for_path(self, path):
 | 
			
		||||
        # type: (ConfigPath) -> Optional[ESPHomeDataBase]
 | 
			
		||||
    def get_deepest_document_range_for_path(self, path, get_key=False):
 | 
			
		||||
        # type: (ConfigPath, bool) -> Optional[ESPHomeDataBase]
 | 
			
		||||
        data = self
 | 
			
		||||
        doc_range = None
 | 
			
		||||
        for item_index in path:
 | 
			
		||||
        for index, path_item in enumerate(path):
 | 
			
		||||
            try:
 | 
			
		||||
                if item_index in data:
 | 
			
		||||
                    doc_range = [x for x in data.keys() if x == item_index][0].esp_range
 | 
			
		||||
                data = data[item_index]
 | 
			
		||||
                if path_item in data:
 | 
			
		||||
                    key_data = [x for x in data.keys() if x == path_item][0]
 | 
			
		||||
                    if isinstance(key_data, ESPHomeDataBase):
 | 
			
		||||
                        doc_range = key_data.esp_range
 | 
			
		||||
                        if get_key and index == len(path) - 1:
 | 
			
		||||
                            return doc_range
 | 
			
		||||
                data = data[path_item]
 | 
			
		||||
            except (KeyError, IndexError, TypeError, AttributeError):
 | 
			
		||||
                return doc_range
 | 
			
		||||
            if isinstance(data, core.ID):
 | 
			
		||||
@@ -281,7 +285,7 @@ class ConfigValidationStep(abc.ABC):
 | 
			
		||||
class LoadValidationStep(ConfigValidationStep):
 | 
			
		||||
    """Load step, this step is called once for each domain config fragment.
 | 
			
		||||
 | 
			
		||||
    Responsibilties:
 | 
			
		||||
    Responsibilities:
 | 
			
		||||
    - Load component code
 | 
			
		||||
    - Ensure all AUTO_LOADs are added
 | 
			
		||||
    - Set output paths of result
 | 
			
		||||
@@ -738,6 +742,10 @@ def validate_config(config, command_line_substitutions) -> Config:
 | 
			
		||||
            result.add_validation_step(LoadValidationStep(key, config[key]))
 | 
			
		||||
    result.run_validation_steps()
 | 
			
		||||
 | 
			
		||||
    if result.errors:
 | 
			
		||||
        # do not try to validate further as we don't know what the target is
 | 
			
		||||
        return result
 | 
			
		||||
 | 
			
		||||
    for domain, conf in config.items():
 | 
			
		||||
        result.add_validation_step(LoadValidationStep(domain, conf))
 | 
			
		||||
    result.add_validation_step(IDPassValidationStep())
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
"""Constants used by esphome."""
 | 
			
		||||
 | 
			
		||||
__version__ = "2022.9.0b2"
 | 
			
		||||
__version__ = "2022.9.2"
 | 
			
		||||
 | 
			
		||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -179,7 +179,11 @@ def preload_core_config(config, result):
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
    if not has_oldstyle and not newstyle_found:
 | 
			
		||||
        raise cv.Invalid("Platform missing for core options!", [CONF_ESPHOME])
 | 
			
		||||
        raise cv.Invalid(
 | 
			
		||||
            "Platform missing. You must include one of the available platform keys: "
 | 
			
		||||
            + ", ".join(TARGET_PLATFORMS),
 | 
			
		||||
            [CONF_ESPHOME],
 | 
			
		||||
        )
 | 
			
		||||
    if has_oldstyle and newstyle_found:
 | 
			
		||||
        raise cv.Invalid(
 | 
			
		||||
            f"Please remove the `platform` key from the [esphome] block. You're already using the new style with the [{conf[CONF_PLATFORM]}] block",
 | 
			
		||||
 
 | 
			
		||||
@@ -12,7 +12,9 @@ from typing import Optional
 | 
			
		||||
 | 
			
		||||
def _get_invalid_range(res, invalid):
 | 
			
		||||
    # type: (Config, cv.Invalid) -> Optional[DocumentRange]
 | 
			
		||||
    return res.get_deepest_document_range_for_path(invalid.path)
 | 
			
		||||
    return res.get_deepest_document_range_for_path(
 | 
			
		||||
        invalid.path, invalid.error_message == "extra keys not allowed"
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def _dump_range(range):
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@ pyserial==3.5
 | 
			
		||||
platformio==6.0.2  # When updating platformio, also update Dockerfile
 | 
			
		||||
esptool==3.3.1
 | 
			
		||||
click==8.1.3
 | 
			
		||||
esphome-dashboard==20220508.0
 | 
			
		||||
esphome-dashboard==20220925.0
 | 
			
		||||
aioesphomeapi==10.13.0
 | 
			
		||||
zeroconf==0.39.1
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user