mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 23:21:54 +00:00 
			
		
		
		
	Merge remote-tracking branch 'upstream/dev' into integration
This commit is contained in:
		| @@ -1056,6 +1056,52 @@ async def sony_action(var, config, args): | |||||||
|     cg.add(var.set_nbits(template_)) |     cg.add(var.set_nbits(template_)) | ||||||
|  |  | ||||||
|  |  | ||||||
|  | # Symphony | ||||||
|  | SymphonyData, SymphonyBinarySensor, SymphonyTrigger, SymphonyAction, SymphonyDumper = ( | ||||||
|  |     declare_protocol("Symphony") | ||||||
|  | ) | ||||||
|  | SYMPHONY_SCHEMA = cv.Schema( | ||||||
|  |     { | ||||||
|  |         cv.Required(CONF_DATA): cv.hex_uint32_t, | ||||||
|  |         cv.Required(CONF_NBITS): cv.int_range(min=1, max=32), | ||||||
|  |         cv.Optional(CONF_COMMAND_REPEATS, default=2): cv.uint8_t, | ||||||
|  |     } | ||||||
|  | ) | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @register_binary_sensor("symphony", SymphonyBinarySensor, SYMPHONY_SCHEMA) | ||||||
|  | def symphony_binary_sensor(var, config): | ||||||
|  |     cg.add( | ||||||
|  |         var.set_data( | ||||||
|  |             cg.StructInitializer( | ||||||
|  |                 SymphonyData, | ||||||
|  |                 ("data", config[CONF_DATA]), | ||||||
|  |                 ("nbits", config[CONF_NBITS]), | ||||||
|  |             ) | ||||||
|  |         ) | ||||||
|  |     ) | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @register_trigger("symphony", SymphonyTrigger, SymphonyData) | ||||||
|  | def symphony_trigger(var, config): | ||||||
|  |     pass | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @register_dumper("symphony", SymphonyDumper) | ||||||
|  | def symphony_dumper(var, config): | ||||||
|  |     pass | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @register_action("symphony", SymphonyAction, SYMPHONY_SCHEMA) | ||||||
|  | async def symphony_action(var, config, args): | ||||||
|  |     template_ = await cg.templatable(config[CONF_DATA], args, cg.uint32) | ||||||
|  |     cg.add(var.set_data(template_)) | ||||||
|  |     template_ = await cg.templatable(config[CONF_NBITS], args, cg.uint32) | ||||||
|  |     cg.add(var.set_nbits(template_)) | ||||||
|  |     template_ = await cg.templatable(config[CONF_COMMAND_REPEATS], args, cg.uint8) | ||||||
|  |     cg.add(var.set_repeats(template_)) | ||||||
|  |  | ||||||
|  |  | ||||||
| # Raw | # Raw | ||||||
| def validate_raw_alternating(value): | def validate_raw_alternating(value): | ||||||
|     assert isinstance(value, list) |     assert isinstance(value, list) | ||||||
|   | |||||||
							
								
								
									
										120
									
								
								esphome/components/remote_base/symphony_protocol.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										120
									
								
								esphome/components/remote_base/symphony_protocol.cpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,120 @@ | |||||||
|  | #include "symphony_protocol.h" | ||||||
|  | #include "esphome/core/log.h" | ||||||
|  |  | ||||||
|  | namespace esphome { | ||||||
|  | namespace remote_base { | ||||||
|  |  | ||||||
|  | static const char *const TAG = "remote.symphony"; | ||||||
|  |  | ||||||
|  | // Reference implementation and timing details: | ||||||
|  | // IRremoteESP8266 ir_Symphony.cpp | ||||||
|  | // https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Symphony.cpp | ||||||
|  | // The implementation below mirrors the constant bit-time mapping and | ||||||
|  | // footer-gap handling used there. | ||||||
|  |  | ||||||
|  | // Symphony protocol timing specifications (tuned to handset captures) | ||||||
|  | static const uint32_t BIT_ZERO_HIGH_US = 460;  // short | ||||||
|  | static const uint32_t BIT_ZERO_LOW_US = 1260;  // long | ||||||
|  | static const uint32_t BIT_ONE_HIGH_US = 1260;  // long | ||||||
|  | static const uint32_t BIT_ONE_LOW_US = 460;    // short | ||||||
|  | static const uint32_t CARRIER_FREQUENCY = 38000; | ||||||
|  |  | ||||||
|  | // IRremoteESP8266 reference: kSymphonyFooterGap = 4 * (mark + space) | ||||||
|  | static const uint32_t FOOTER_GAP_US = 4 * (BIT_ZERO_HIGH_US + BIT_ZERO_LOW_US); | ||||||
|  | // Typical inter-frame gap (~34.8 ms observed) | ||||||
|  | static const uint32_t INTER_FRAME_GAP_US = 34760; | ||||||
|  |  | ||||||
|  | void SymphonyProtocol::encode(RemoteTransmitData *dst, const SymphonyData &data) { | ||||||
|  |   dst->set_carrier_frequency(CARRIER_FREQUENCY); | ||||||
|  |   ESP_LOGD(TAG, "Sending Symphony: data=0x%0*X nbits=%u repeats=%u", (data.nbits + 3) / 4, (uint32_t) data.data, | ||||||
|  |            data.nbits, data.repeats); | ||||||
|  |   // Each bit produces a mark+space (2 entries). We fold the inter-frame/footer gap | ||||||
|  |   // into the last bit's space of each frame to avoid over-length gaps. | ||||||
|  |   dst->reserve(data.nbits * 2u * data.repeats); | ||||||
|  |  | ||||||
|  |   for (uint8_t repeats = 0; repeats < data.repeats; repeats++) { | ||||||
|  |     // Data bits (MSB first) | ||||||
|  |     for (uint32_t mask = 1UL << (data.nbits - 1); mask != 0; mask >>= 1) { | ||||||
|  |       const bool is_last_bit = (mask == 1); | ||||||
|  |       const bool is_last_frame = (repeats == (data.repeats - 1)); | ||||||
|  |       if (is_last_bit) { | ||||||
|  |         // Emit last bit's mark; replace its space with the proper gap | ||||||
|  |         if (data.data & mask) { | ||||||
|  |           dst->mark(BIT_ONE_HIGH_US); | ||||||
|  |         } else { | ||||||
|  |           dst->mark(BIT_ZERO_HIGH_US); | ||||||
|  |         } | ||||||
|  |         dst->space(is_last_frame ? FOOTER_GAP_US : INTER_FRAME_GAP_US); | ||||||
|  |       } else { | ||||||
|  |         if (data.data & mask) { | ||||||
|  |           dst->item(BIT_ONE_HIGH_US, BIT_ONE_LOW_US); | ||||||
|  |         } else { | ||||||
|  |           dst->item(BIT_ZERO_HIGH_US, BIT_ZERO_LOW_US); | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | optional<SymphonyData> SymphonyProtocol::decode(RemoteReceiveData src) { | ||||||
|  |   auto is_valid_len = [](uint8_t nbits) -> bool { return nbits == 8 || nbits == 12 || nbits == 16; }; | ||||||
|  |  | ||||||
|  |   RemoteReceiveData s = src;  // copy | ||||||
|  |   SymphonyData out{0, 0, 1}; | ||||||
|  |  | ||||||
|  |   for (; out.nbits < 32; out.nbits++) { | ||||||
|  |     if (s.expect_mark(BIT_ONE_HIGH_US)) { | ||||||
|  |       if (!s.expect_space(BIT_ONE_LOW_US)) { | ||||||
|  |         // Allow footer gap immediately after the last mark | ||||||
|  |         if (s.peek_space_at_least(FOOTER_GAP_US)) { | ||||||
|  |           uint8_t bits_with_this = out.nbits + 1; | ||||||
|  |           if (is_valid_len(bits_with_this)) { | ||||||
|  |             out.data = (out.data << 1UL) | 1UL; | ||||||
|  |             out.nbits = bits_with_this; | ||||||
|  |             return out; | ||||||
|  |           } | ||||||
|  |         } | ||||||
|  |         return {}; | ||||||
|  |       } | ||||||
|  |       // Successfully consumed a '1' bit (mark + space) | ||||||
|  |       out.data = (out.data << 1UL) | 1UL; | ||||||
|  |       continue; | ||||||
|  |     } else if (s.expect_mark(BIT_ZERO_HIGH_US)) { | ||||||
|  |       if (!s.expect_space(BIT_ZERO_LOW_US)) { | ||||||
|  |         // Allow footer gap immediately after the last mark | ||||||
|  |         if (s.peek_space_at_least(FOOTER_GAP_US)) { | ||||||
|  |           uint8_t bits_with_this = out.nbits + 1; | ||||||
|  |           if (is_valid_len(bits_with_this)) { | ||||||
|  |             out.data = (out.data << 1UL) | 0UL; | ||||||
|  |             out.nbits = bits_with_this; | ||||||
|  |             return out; | ||||||
|  |           } | ||||||
|  |         } | ||||||
|  |         return {}; | ||||||
|  |       } | ||||||
|  |       // Successfully consumed a '0' bit (mark + space) | ||||||
|  |       out.data = (out.data << 1UL) | 0UL; | ||||||
|  |       continue; | ||||||
|  |     } else { | ||||||
|  |       // Completed a valid-length frame followed by a footer gap | ||||||
|  |       if (is_valid_len(out.nbits) && s.peek_space_at_least(FOOTER_GAP_US)) { | ||||||
|  |         return out; | ||||||
|  |       } | ||||||
|  |       return {}; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   if (is_valid_len(out.nbits) && s.peek_space_at_least(FOOTER_GAP_US)) { | ||||||
|  |     return out; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   return {}; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | void SymphonyProtocol::dump(const SymphonyData &data) { | ||||||
|  |   const int32_t hex_width = (data.nbits + 3) / 4;  // pad to nibble width | ||||||
|  |   ESP_LOGI(TAG, "Received Symphony: data=0x%0*X, nbits=%d", hex_width, (uint32_t) data.data, data.nbits); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | }  // namespace remote_base | ||||||
|  | }  // namespace esphome | ||||||
							
								
								
									
										44
									
								
								esphome/components/remote_base/symphony_protocol.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								esphome/components/remote_base/symphony_protocol.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,44 @@ | |||||||
|  | #pragma once | ||||||
|  |  | ||||||
|  | #include "esphome/core/component.h" | ||||||
|  | #include "remote_base.h" | ||||||
|  |  | ||||||
|  | #include <cinttypes> | ||||||
|  |  | ||||||
|  | namespace esphome { | ||||||
|  | namespace remote_base { | ||||||
|  |  | ||||||
|  | struct SymphonyData { | ||||||
|  |   uint32_t data; | ||||||
|  |   uint8_t nbits; | ||||||
|  |   uint8_t repeats{1}; | ||||||
|  |  | ||||||
|  |   bool operator==(const SymphonyData &rhs) const { return data == rhs.data && nbits == rhs.nbits; } | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | class SymphonyProtocol : public RemoteProtocol<SymphonyData> { | ||||||
|  |  public: | ||||||
|  |   void encode(RemoteTransmitData *dst, const SymphonyData &data) override; | ||||||
|  |   optional<SymphonyData> decode(RemoteReceiveData src) override; | ||||||
|  |   void dump(const SymphonyData &data) override; | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | DECLARE_REMOTE_PROTOCOL(Symphony) | ||||||
|  |  | ||||||
|  | template<typename... Ts> class SymphonyAction : public RemoteTransmitterActionBase<Ts...> { | ||||||
|  |  public: | ||||||
|  |   TEMPLATABLE_VALUE(uint32_t, data) | ||||||
|  |   TEMPLATABLE_VALUE(uint8_t, nbits) | ||||||
|  |   TEMPLATABLE_VALUE(uint8_t, repeats) | ||||||
|  |  | ||||||
|  |   void encode(RemoteTransmitData *dst, Ts... x) override { | ||||||
|  |     SymphonyData data{}; | ||||||
|  |     data.data = this->data_.value(x...); | ||||||
|  |     data.nbits = this->nbits_.value(x...); | ||||||
|  |     data.repeats = this->repeats_.value(x...); | ||||||
|  |     SymphonyProtocol().encode(dst, data); | ||||||
|  |   } | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | }  // namespace remote_base | ||||||
|  | }  // namespace esphome | ||||||
| @@ -3,6 +3,7 @@ from esphome.components import i2c, sensor | |||||||
| import esphome.config_validation as cv | import esphome.config_validation as cv | ||||||
| from esphome.const import ( | from esphome.const import ( | ||||||
|     CONF_ID, |     CONF_ID, | ||||||
|  |     CONF_OVERSAMPLING, | ||||||
|     CONF_PRESSURE, |     CONF_PRESSURE, | ||||||
|     CONF_TEMPERATURE, |     CONF_TEMPERATURE, | ||||||
|     DEVICE_CLASS_PRESSURE, |     DEVICE_CLASS_PRESSURE, | ||||||
| @@ -18,6 +19,17 @@ CODEOWNERS = ["@gcormier"] | |||||||
| CONF_K_VALUE = "k_value" | CONF_K_VALUE = "k_value" | ||||||
|  |  | ||||||
| xgzp68xx_ns = cg.esphome_ns.namespace("xgzp68xx") | xgzp68xx_ns = cg.esphome_ns.namespace("xgzp68xx") | ||||||
|  | XGZP68XXOversampling = xgzp68xx_ns.enum("XGZP68XXOversampling") | ||||||
|  | OVERSAMPLING_OPTIONS = { | ||||||
|  |     "256X": XGZP68XXOversampling.XGZP68XX_OVERSAMPLING_256X, | ||||||
|  |     "512X": XGZP68XXOversampling.XGZP68XX_OVERSAMPLING_512X, | ||||||
|  |     "1024X": XGZP68XXOversampling.XGZP68XX_OVERSAMPLING_1024X, | ||||||
|  |     "2048X": XGZP68XXOversampling.XGZP68XX_OVERSAMPLING_2048X, | ||||||
|  |     "4096X": XGZP68XXOversampling.XGZP68XX_OVERSAMPLING_4096X, | ||||||
|  |     "8192X": XGZP68XXOversampling.XGZP68XX_OVERSAMPLING_8192X, | ||||||
|  |     "16384X": XGZP68XXOversampling.XGZP68XX_OVERSAMPLING_16384X, | ||||||
|  |     "32768X": XGZP68XXOversampling.XGZP68XX_OVERSAMPLING_32768X, | ||||||
|  | } | ||||||
| XGZP68XXComponent = xgzp68xx_ns.class_( | XGZP68XXComponent = xgzp68xx_ns.class_( | ||||||
|     "XGZP68XXComponent", cg.PollingComponent, i2c.I2CDevice |     "XGZP68XXComponent", cg.PollingComponent, i2c.I2CDevice | ||||||
| ) | ) | ||||||
| @@ -31,6 +43,12 @@ CONFIG_SCHEMA = ( | |||||||
|                 accuracy_decimals=1, |                 accuracy_decimals=1, | ||||||
|                 device_class=DEVICE_CLASS_PRESSURE, |                 device_class=DEVICE_CLASS_PRESSURE, | ||||||
|                 state_class=STATE_CLASS_MEASUREMENT, |                 state_class=STATE_CLASS_MEASUREMENT, | ||||||
|  |             ).extend( | ||||||
|  |                 { | ||||||
|  |                     cv.Optional(CONF_OVERSAMPLING, default="4096X"): cv.enum( | ||||||
|  |                         OVERSAMPLING_OPTIONS, upper=True | ||||||
|  |                     ), | ||||||
|  |                 } | ||||||
|             ), |             ), | ||||||
|             cv.Optional(CONF_TEMPERATURE): sensor.sensor_schema( |             cv.Optional(CONF_TEMPERATURE): sensor.sensor_schema( | ||||||
|                 unit_of_measurement=UNIT_CELSIUS, |                 unit_of_measurement=UNIT_CELSIUS, | ||||||
| @@ -58,5 +76,6 @@ async def to_code(config): | |||||||
|     if pressure_config := config.get(CONF_PRESSURE): |     if pressure_config := config.get(CONF_PRESSURE): | ||||||
|         sens = await sensor.new_sensor(pressure_config) |         sens = await sensor.new_sensor(pressure_config) | ||||||
|         cg.add(var.set_pressure_sensor(sens)) |         cg.add(var.set_pressure_sensor(sens)) | ||||||
|  |         cg.add(var.set_pressure_oversampling(pressure_config[CONF_OVERSAMPLING])) | ||||||
|  |  | ||||||
|     cg.add(var.set_k_value(config[CONF_K_VALUE])) |     cg.add(var.set_k_value(config[CONF_K_VALUE])) | ||||||
|   | |||||||
| @@ -16,16 +16,49 @@ static const uint8_t SYSCONFIG_ADDRESS = 0xA5; | |||||||
| static const uint8_t PCONFIG_ADDRESS = 0xA6; | static const uint8_t PCONFIG_ADDRESS = 0xA6; | ||||||
| static const uint8_t READ_COMMAND = 0x0A; | static const uint8_t READ_COMMAND = 0x0A; | ||||||
|  |  | ||||||
|  | [[maybe_unused]] static const char *oversampling_to_str(XGZP68XXOversampling oversampling) { | ||||||
|  |   switch (oversampling) { | ||||||
|  |     case XGZP68XX_OVERSAMPLING_256X: | ||||||
|  |       return "256x"; | ||||||
|  |     case XGZP68XX_OVERSAMPLING_512X: | ||||||
|  |       return "512x"; | ||||||
|  |     case XGZP68XX_OVERSAMPLING_1024X: | ||||||
|  |       return "1024x"; | ||||||
|  |     case XGZP68XX_OVERSAMPLING_2048X: | ||||||
|  |       return "2048x"; | ||||||
|  |     case XGZP68XX_OVERSAMPLING_4096X: | ||||||
|  |       return "4096x"; | ||||||
|  |     case XGZP68XX_OVERSAMPLING_8192X: | ||||||
|  |       return "8192x"; | ||||||
|  |     case XGZP68XX_OVERSAMPLING_16384X: | ||||||
|  |       return "16384x"; | ||||||
|  |     case XGZP68XX_OVERSAMPLING_32768X: | ||||||
|  |       return "32768x"; | ||||||
|  |     default: | ||||||
|  |       return "UNKNOWN"; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
| void XGZP68XXComponent::update() { | void XGZP68XXComponent::update() { | ||||||
|  |   // Do we need to change oversampling? | ||||||
|  |   if (this->last_pressure_oversampling_ != this->pressure_oversampling_) { | ||||||
|  |     uint8_t oldconfig = 0; | ||||||
|  |     this->read_register(PCONFIG_ADDRESS, &oldconfig, 1); | ||||||
|  |     uint8_t newconfig = (oldconfig & 0xf8) | (this->pressure_oversampling_ & 0x7); | ||||||
|  |     this->write_register(PCONFIG_ADDRESS, &newconfig, 1); | ||||||
|  |     ESP_LOGD(TAG, "oversampling to %s: oldconfig = 0x%x newconfig = 0x%x", | ||||||
|  |              oversampling_to_str(this->pressure_oversampling_), oldconfig, newconfig); | ||||||
|  |     this->last_pressure_oversampling_ = this->pressure_oversampling_; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   // Request temp + pressure acquisition |   // Request temp + pressure acquisition | ||||||
|   this->write_register(0x30, &READ_COMMAND, 1); |   this->write_register(0x30, &READ_COMMAND, 1); | ||||||
|  |  | ||||||
|   // Wait 20mS per datasheet |   // Wait 20mS per datasheet | ||||||
|   this->set_timeout("measurement", 20, [this]() { |   this->set_timeout("measurement", 20, [this]() { | ||||||
|     uint8_t data[5]; |     uint8_t data[5] = {}; | ||||||
|     uint32_t pressure_raw; |     uint32_t pressure_raw = 0; | ||||||
|     uint16_t temperature_raw; |     uint16_t temperature_raw = 0; | ||||||
|     float pressure_in_pa, temperature; |  | ||||||
|     int success; |     int success; | ||||||
|  |  | ||||||
|     // Read the sensor data |     // Read the sensor data | ||||||
| @@ -42,23 +75,11 @@ void XGZP68XXComponent::update() { | |||||||
|     ESP_LOGV(TAG, "Got raw pressure=%" PRIu32 ", raw temperature=%u", pressure_raw, temperature_raw); |     ESP_LOGV(TAG, "Got raw pressure=%" PRIu32 ", raw temperature=%u", pressure_raw, temperature_raw); | ||||||
|     ESP_LOGV(TAG, "K value is %u", this->k_value_); |     ESP_LOGV(TAG, "K value is %u", this->k_value_); | ||||||
|  |  | ||||||
|     // The most significant bit of both pressure and temperature will be 1 to indicate a negative value. |     // Sign extend the pressure | ||||||
|     // This is directly from the datasheet, and the calculations below will handle this. |     float pressure_in_pa = (float) (((int32_t) pressure_raw << 8) >> 8); | ||||||
|     if (pressure_raw > pow(2, 23)) { |     pressure_in_pa /= (float) (this->k_value_); | ||||||
|       // Negative pressure |  | ||||||
|       pressure_in_pa = (pressure_raw - pow(2, 24)) / (float) (this->k_value_); |  | ||||||
|     } else { |  | ||||||
|       // Positive pressure |  | ||||||
|       pressure_in_pa = pressure_raw / (float) (this->k_value_); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     if (temperature_raw > pow(2, 15)) { |     float temperature = ((float) (int16_t) temperature_raw) / 256.0f; | ||||||
|       // Negative temperature |  | ||||||
|       temperature = (float) (temperature_raw - pow(2, 16)) / 256.0f; |  | ||||||
|     } else { |  | ||||||
|       // Positive temperature |  | ||||||
|       temperature = (float) temperature_raw / 256.0f; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     if (this->pressure_sensor_ != nullptr) |     if (this->pressure_sensor_ != nullptr) | ||||||
|       this->pressure_sensor_->publish_state(pressure_in_pa); |       this->pressure_sensor_->publish_state(pressure_in_pa); | ||||||
| @@ -69,20 +90,27 @@ void XGZP68XXComponent::update() { | |||||||
| } | } | ||||||
|  |  | ||||||
| void XGZP68XXComponent::setup() { | void XGZP68XXComponent::setup() { | ||||||
|   uint8_t config; |   uint8_t config1 = 0, config2 = 0; | ||||||
|  |  | ||||||
|   // Display some sample bits to confirm we are talking to the sensor |   // Display some sample bits to confirm we are talking to the sensor | ||||||
|   this->read_register(SYSCONFIG_ADDRESS, &config, 1); |   if (i2c::ErrorCode::ERROR_OK != this->read_register(SYSCONFIG_ADDRESS, &config1, 1)) { | ||||||
|   ESP_LOGCONFIG(TAG, |     this->mark_failed(); | ||||||
|                 "Gain value is %d\n" |     return; | ||||||
|                 "XGZP68xx started!", |   } | ||||||
|                 (config >> 3) & 0b111); |   if (i2c::ErrorCode::ERROR_OK != this->read_register(PCONFIG_ADDRESS, &config2, 1)) { | ||||||
|  |     this->mark_failed(); | ||||||
|  |     return; | ||||||
|  |   } | ||||||
|  |   ESP_LOGD(TAG, "sys_config 0x%x, p_config 0x%x", config1, config2); | ||||||
| } | } | ||||||
|  |  | ||||||
| void XGZP68XXComponent::dump_config() { | void XGZP68XXComponent::dump_config() { | ||||||
|   ESP_LOGCONFIG(TAG, "XGZP68xx:"); |   ESP_LOGCONFIG(TAG, "XGZP68xx:"); | ||||||
|   LOG_SENSOR("  ", "Temperature: ", this->temperature_sensor_); |   LOG_SENSOR("  ", "Temperature: ", this->temperature_sensor_); | ||||||
|   LOG_SENSOR("  ", "Pressure: ", this->pressure_sensor_); |   LOG_SENSOR("  ", "Pressure: ", this->pressure_sensor_); | ||||||
|  |   if (this->pressure_sensor_ != nullptr) { | ||||||
|  |     ESP_LOGCONFIG(TAG, "    Oversampling: %s", oversampling_to_str(this->pressure_oversampling_)); | ||||||
|  |   } | ||||||
|   LOG_I2C_DEVICE(this); |   LOG_I2C_DEVICE(this); | ||||||
|   if (this->is_failed()) { |   if (this->is_failed()) { | ||||||
|     ESP_LOGE(TAG, "  Connection failed"); |     ESP_LOGE(TAG, "  Connection failed"); | ||||||
|   | |||||||
| @@ -7,11 +7,29 @@ | |||||||
| namespace esphome { | namespace esphome { | ||||||
| namespace xgzp68xx { | namespace xgzp68xx { | ||||||
|  |  | ||||||
|  | /// Enum listing all oversampling options for the XGZP68XX. | ||||||
|  | enum XGZP68XXOversampling : uint8_t { | ||||||
|  |   XGZP68XX_OVERSAMPLING_256X = 0b100, | ||||||
|  |   XGZP68XX_OVERSAMPLING_512X = 0b101, | ||||||
|  |   XGZP68XX_OVERSAMPLING_1024X = 0b000, | ||||||
|  |   XGZP68XX_OVERSAMPLING_2048X = 0b001, | ||||||
|  |   XGZP68XX_OVERSAMPLING_4096X = 0b010, | ||||||
|  |   XGZP68XX_OVERSAMPLING_8192X = 0b011, | ||||||
|  |   XGZP68XX_OVERSAMPLING_16384X = 0b110, | ||||||
|  |   XGZP68XX_OVERSAMPLING_32768X = 0b111, | ||||||
|  |  | ||||||
|  |   XGZP68XX_OVERSAMPLING_UNKNOWN = (uint8_t) -1, | ||||||
|  | }; | ||||||
|  |  | ||||||
| class XGZP68XXComponent : public PollingComponent, public sensor::Sensor, public i2c::I2CDevice { | class XGZP68XXComponent : public PollingComponent, public sensor::Sensor, public i2c::I2CDevice { | ||||||
|  public: |  public: | ||||||
|   SUB_SENSOR(temperature) |   SUB_SENSOR(temperature) | ||||||
|   SUB_SENSOR(pressure) |   SUB_SENSOR(pressure) | ||||||
|   void set_k_value(uint16_t k_value) { this->k_value_ = k_value; } |   void set_k_value(uint16_t k_value) { this->k_value_ = k_value; } | ||||||
|  |   /// Set the pressure oversampling value. Defaults to 4096X. | ||||||
|  |   void set_pressure_oversampling(XGZP68XXOversampling pressure_oversampling) { | ||||||
|  |     this->pressure_oversampling_ = pressure_oversampling; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   void update() override; |   void update() override; | ||||||
|   void setup() override; |   void setup() override; | ||||||
| @@ -21,6 +39,8 @@ class XGZP68XXComponent : public PollingComponent, public sensor::Sensor, public | |||||||
|   /// Internal method to read the pressure from the component after it has been scheduled. |   /// Internal method to read the pressure from the component after it has been scheduled. | ||||||
|   void read_pressure_(); |   void read_pressure_(); | ||||||
|   uint16_t k_value_; |   uint16_t k_value_; | ||||||
|  |   XGZP68XXOversampling pressure_oversampling_{XGZP68XX_OVERSAMPLING_4096X}; | ||||||
|  |   XGZP68XXOversampling last_pressure_oversampling_{XGZP68XX_OVERSAMPLING_UNKNOWN}; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| }  // namespace xgzp68xx | }  // namespace xgzp68xx | ||||||
|   | |||||||
| @@ -50,7 +50,14 @@ PACKAGE_DEPENDENCIES = { | |||||||
|  |  | ||||||
| # Bus types that can be defined directly in config files | # Bus types that can be defined directly in config files | ||||||
| # Components defining these directly cannot be grouped (they create unique bus IDs) | # Components defining these directly cannot be grouped (they create unique bus IDs) | ||||||
| DIRECT_BUS_TYPES = ("i2c", "spi", "uart", "modbus") | DIRECT_BUS_TYPES = ( | ||||||
|  |     "i2c", | ||||||
|  |     "spi", | ||||||
|  |     "uart", | ||||||
|  |     "modbus", | ||||||
|  |     "remote_transmitter", | ||||||
|  |     "remote_receiver", | ||||||
|  | ) | ||||||
|  |  | ||||||
| # Signature for components with no bus requirements | # Signature for components with no bus requirements | ||||||
| # These components can be merged with any other group | # These components can be merged with any other group | ||||||
| @@ -68,6 +75,8 @@ BASE_BUS_COMPONENTS = { | |||||||
|     "uart", |     "uart", | ||||||
|     "modbus", |     "modbus", | ||||||
|     "canbus", |     "canbus", | ||||||
|  |     "remote_transmitter", | ||||||
|  |     "remote_receiver", | ||||||
| } | } | ||||||
|  |  | ||||||
| # Components that must be tested in isolation (not grouped or batched with others) | # Components that must be tested in isolation (not grouped or batched with others) | ||||||
|   | |||||||
| @@ -1,7 +1,3 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: ${pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: heatpumpir |   - platform: heatpumpir | ||||||
|     protocol: ballu |     protocol: ballu | ||||||
| @@ -10,3 +6,4 @@ climate: | |||||||
|     name: HeatpumpIR Climate |     name: HeatpumpIR Climate | ||||||
|     min_temperature: 18 |     min_temperature: 18 | ||||||
|     max_temperature: 30 |     max_temperature: 30 | ||||||
|  |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO5 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,7 +1,4 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: ${pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: climate_ir_lg |   - platform: climate_ir_lg | ||||||
|     name: LG Climate |     name: LG Climate | ||||||
|  |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-c3-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO5 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,7 +1,4 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: ${pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: coolix |   - platform: coolix | ||||||
|     name: Coolix Climate |     name: Coolix Climate | ||||||
|  |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-c3-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO5 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,7 +1,3 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: ${pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: heatpumpir |   - platform: heatpumpir | ||||||
|     protocol: daikin |     protocol: daikin | ||||||
| @@ -10,3 +6,4 @@ climate: | |||||||
|     name: HeatpumpIR Climate |     name: HeatpumpIR Climate | ||||||
|     min_temperature: 18 |     min_temperature: 18 | ||||||
|     max_temperature: 30 |     max_temperature: 30 | ||||||
|  |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO5 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,18 +1,3 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: ${tx_pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|   id: tsvr |  | ||||||
|  |  | ||||||
| remote_receiver: |  | ||||||
|   id: rcvr |  | ||||||
|   pin: |  | ||||||
|     number: ${rx_pin} |  | ||||||
|     inverted: true |  | ||||||
|     mode: |  | ||||||
|       input: true |  | ||||||
|       pullup: true |  | ||||||
|   tolerance: 40% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: daikin_arc |   - platform: daikin_arc | ||||||
|     name: Daikin AC |     name: Daikin AC | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| substitutions: | packages: | ||||||
|   tx_pin: GPIO0 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|   rx_pin: GPIO2 |   remote_receiver: !include ../../test_build_components/common/remote_receiver/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,7 +1,4 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: ${pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: daikin_brc |   - platform: daikin_brc | ||||||
|     name: Daikin_brc Climate |     name: Daikin_brc Climate | ||||||
|  |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-c3-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO5 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,7 +1,4 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: ${pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: delonghi |   - platform: delonghi | ||||||
|     name: Delonghi Climate |     name: Delonghi Climate | ||||||
|  |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-c3-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO5 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,14 +1,5 @@ | |||||||
| remote_transmitter: |  | ||||||
|   id: tx |  | ||||||
|   pin: ${remote_transmitter_pin} |  | ||||||
|   carrier_duty_percent: 100% |  | ||||||
|  |  | ||||||
| remote_receiver: |  | ||||||
|   id: rcvr |  | ||||||
|   pin: ${remote_receiver_pin} |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: emmeti |   - platform: emmeti | ||||||
|     name: Emmeti |     name: Emmeti | ||||||
|     receiver_id: rcvr |     receiver_id: rcvr | ||||||
|     transmitter_id: tx |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| substitutions: | packages: | ||||||
|   remote_transmitter_pin: GPIO33 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml | ||||||
|   remote_receiver_pin: GPIO32 |   remote_receiver: !include ../../test_build_components/common/remote_receiver/esp32-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| substitutions: | packages: | ||||||
|   remote_transmitter_pin: GPIO0 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|   remote_receiver_pin: GPIO2 |   remote_receiver: !include ../../test_build_components/common/remote_receiver/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,7 +1,4 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: ${pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: fujitsu_general |   - platform: fujitsu_general | ||||||
|     name: Fujitsu General Climate |     name: Fujitsu General Climate | ||||||
|  |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-c3-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO5 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,8 +1,5 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: ${pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: gree |   - platform: gree | ||||||
|     name: GREE |     name: GREE | ||||||
|     model: generic |     model: generic | ||||||
|  |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-c3-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO5 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,7 +1,3 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: ${pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: heatpumpir |   - platform: heatpumpir | ||||||
|     protocol: mitsubishi_heavy_zm |     protocol: mitsubishi_heavy_zm | ||||||
| @@ -10,6 +6,7 @@ climate: | |||||||
|     name: HeatpumpIR Climate Mitsubishi |     name: HeatpumpIR Climate Mitsubishi | ||||||
|     min_temperature: 18 |     min_temperature: 18 | ||||||
|     max_temperature: 30 |     max_temperature: 30 | ||||||
|  |     transmitter_id: xmitr | ||||||
|   - platform: heatpumpir |   - platform: heatpumpir | ||||||
|     protocol: daikin |     protocol: daikin | ||||||
|     horizontal_default: mleft |     horizontal_default: mleft | ||||||
| @@ -17,6 +14,7 @@ climate: | |||||||
|     name: HeatpumpIR Climate Daikin |     name: HeatpumpIR Climate Daikin | ||||||
|     min_temperature: 18 |     min_temperature: 18 | ||||||
|     max_temperature: 30 |     max_temperature: 30 | ||||||
|  |     transmitter_id: xmitr | ||||||
|   - platform: heatpumpir |   - platform: heatpumpir | ||||||
|     protocol: panasonic_altdke |     protocol: panasonic_altdke | ||||||
|     horizontal_default: mright |     horizontal_default: mright | ||||||
| @@ -24,3 +22,4 @@ climate: | |||||||
|     name: HeatpumpIR Climate Panasonic |     name: HeatpumpIR Climate Panasonic | ||||||
|     min_temperature: 18 |     min_temperature: 18 | ||||||
|     max_temperature: 30 |     max_temperature: 30 | ||||||
|  |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO6 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/bk72xx-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO5 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,7 +1,4 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: ${pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: hitachi_ac344 |   - platform: hitachi_ac344 | ||||||
|     name: Hitachi Climate |     name: Hitachi Climate | ||||||
|  |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO6 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/bk72xx-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-c3-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO5 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,7 +1,4 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: ${pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: hitachi_ac424 |   - platform: hitachi_ac424 | ||||||
|     name: Hitachi Climate |     name: Hitachi Climate | ||||||
|  |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO6 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/bk72xx-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-c3-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO5 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -2,10 +2,6 @@ wifi: | |||||||
|   ssid: MySSID |   ssid: MySSID | ||||||
|   password: password1 |   password: password1 | ||||||
|  |  | ||||||
| remote_transmitter: |  | ||||||
|   pin: ${pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: midea |   - platform: midea | ||||||
|     id: midea_unit |     id: midea_unit | ||||||
| @@ -16,7 +12,7 @@ climate: | |||||||
|           x.set_mode(CLIMATE_MODE_FAN_ONLY); |           x.set_mode(CLIMATE_MODE_FAN_ONLY); | ||||||
|     on_state: |     on_state: | ||||||
|       - logger.log: State changed! |       - logger.log: State changed! | ||||||
|     transmitter_id: |     transmitter_id: xmitr | ||||||
|     period: 1s |     period: 1s | ||||||
|     num_attempts: 5 |     num_attempts: 5 | ||||||
|     timeout: 2s |     timeout: 2s | ||||||
|   | |||||||
| @@ -1,7 +1,5 @@ | |||||||
| substitutions: |  | ||||||
|   pin: GPIO2 |  | ||||||
|  |  | ||||||
| packages: | packages: | ||||||
|  |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-ard.yaml | ||||||
|   uart: !include ../../test_build_components/common/uart/esp32-ard.yaml |   uart: !include ../../test_build_components/common/uart/esp32-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,7 +1,5 @@ | |||||||
| substitutions: |  | ||||||
|   pin: GPIO15 |  | ||||||
|  |  | ||||||
| packages: | packages: | ||||||
|  |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|   uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml |   uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,8 +1,5 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: 4 |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: midea_ir |   - platform: midea_ir | ||||||
|     name: Midea IR |     name: Midea IR | ||||||
|     use_fahrenheit: true |     use_fahrenheit: true | ||||||
|  |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1 +1,4 @@ | |||||||
|  | packages: | ||||||
|  |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-c3-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1 +1,4 @@ | |||||||
|  | packages: | ||||||
|  |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1 +1,4 @@ | |||||||
|  | packages: | ||||||
|  |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,7 +1,4 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: 4 |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: mitsubishi |   - platform: mitsubishi | ||||||
|     name: Mitsubishi |     name: Mitsubishi | ||||||
|  |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1 +1,4 @@ | |||||||
|  | packages: | ||||||
|  |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-c3-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1 +1,4 @@ | |||||||
|  | packages: | ||||||
|  |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1 +1,4 @@ | |||||||
|  | packages: | ||||||
|  |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,12 +1,3 @@ | |||||||
| remote_receiver: |  | ||||||
|   id: rcvr |  | ||||||
|   pin: 4 |  | ||||||
|   dump: all |  | ||||||
|  |  | ||||||
| remote_transmitter: |  | ||||||
|   pin: 2 |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| sensor: | sensor: | ||||||
|   - platform: template |   - platform: template | ||||||
|     id: noblex_ac_sensor |     id: noblex_ac_sensor | ||||||
|   | |||||||
| @@ -1 +1,5 @@ | |||||||
|  | packages: | ||||||
|  |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-c3-idf.yaml | ||||||
|  |   remote_receiver: !include ../../test_build_components/common/remote_receiver/esp32-c3-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1 +1,5 @@ | |||||||
|  | packages: | ||||||
|  |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml | ||||||
|  |   remote_receiver: !include ../../test_build_components/common/remote_receiver/esp32-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1 +1,5 @@ | |||||||
|  | packages: | ||||||
|  |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |   remote_receiver: !include ../../test_build_components/common/remote_receiver/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -128,13 +128,10 @@ valve: | |||||||
|     optimistic: true |     optimistic: true | ||||||
|     has_position: true |     has_position: true | ||||||
|  |  | ||||||
| remote_transmitter: |  | ||||||
|   pin: ${pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: climate_ir_lg |   - platform: climate_ir_lg | ||||||
|     name: LG Climate |     name: LG Climate | ||||||
|  |     transmitter_id: xmitr | ||||||
|  |  | ||||||
| prometheus: | prometheus: | ||||||
|   include_internal: true |   include_internal: true | ||||||
|   | |||||||
| @@ -1,5 +1,7 @@ | |||||||
| substitutions: | substitutions: | ||||||
|   verify_ssl: "false" |   verify_ssl: "false" | ||||||
|   pin: GPIO2 |  | ||||||
|  | packages: | ||||||
|  |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-c3-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| substitutions: | substitutions: | ||||||
|   verify_ssl: "false" |   verify_ssl: "false" | ||||||
|   pin: GPIO2 |  | ||||||
|  |  | ||||||
| packages: | packages: | ||||||
|  |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml | ||||||
|   spi: !include ../../test_build_components/common/spi/esp32-idf.yaml |   spi: !include ../../test_build_components/common/spi/esp32-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,5 +1,7 @@ | |||||||
| substitutions: | substitutions: | ||||||
|   verify_ssl: "false" |   verify_ssl: "false" | ||||||
|   pin: GPIO5 |  | ||||||
|  | packages: | ||||||
|  |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -143,6 +143,11 @@ on_sony: | |||||||
|     - logger.log: |     - logger.log: | ||||||
|         format: "on_sony: %lu %u" |         format: "on_sony: %lu %u" | ||||||
|         args: ["long(x.data)", "x.nbits"] |         args: ["long(x.data)", "x.nbits"] | ||||||
|  | on_symphony: | ||||||
|  |   then: | ||||||
|  |     - logger.log: | ||||||
|  |         format: "on_symphony: 0x%lX %u" | ||||||
|  |         args: ["long(x.data)", "x.nbits"] | ||||||
| on_toshiba_ac: | on_toshiba_ac: | ||||||
|   then: |   then: | ||||||
|     - logger.log: |     - logger.log: | ||||||
|   | |||||||
| @@ -53,6 +53,12 @@ button: | |||||||
|       remote_transmitter.transmit_sony: |       remote_transmitter.transmit_sony: | ||||||
|         data: 0xABCDEF |         data: 0xABCDEF | ||||||
|         nbits: 12 |         nbits: 12 | ||||||
|  |   - platform: template | ||||||
|  |     name: Symphony | ||||||
|  |     on_press: | ||||||
|  |       remote_transmitter.transmit_symphony: | ||||||
|  |         data: 0xE88 | ||||||
|  |         nbits: 12 | ||||||
|   - platform: template |   - platform: template | ||||||
|     name: Panasonic |     name: Panasonic | ||||||
|     on_press: |     on_press: | ||||||
|   | |||||||
| @@ -1,7 +1,3 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: ${pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| sensor: | sensor: | ||||||
|   - platform: template |   - platform: template | ||||||
|     id: tcl112_sensor |     id: tcl112_sensor | ||||||
| @@ -13,3 +9,4 @@ climate: | |||||||
|     supports_heat: true |     supports_heat: true | ||||||
|     supports_cool: true |     supports_cool: true | ||||||
|     sensor: tcl112_sensor |     sensor: tcl112_sensor | ||||||
|  |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-c3-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO5 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,7 +1,4 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: ${pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: toshiba |   - platform: toshiba | ||||||
|     name: Toshiba Climate |     name: Toshiba Climate | ||||||
|  |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-c3-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO5 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,7 +1,4 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: ${pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: whirlpool |   - platform: whirlpool | ||||||
|     name: Whirlpool Climate |     name: Whirlpool Climate | ||||||
|  |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-c3-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO5 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,7 +1,4 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: ${pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: whynter |   - platform: whynter | ||||||
|     name: Whynter Climate |     name: Whynter Climate | ||||||
|  |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-c3-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO5 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -6,3 +6,4 @@ sensor: | |||||||
|       name: Pressure Temperature |       name: Pressure Temperature | ||||||
|     pressure: |     pressure: | ||||||
|       name: Differential pressure |       name: Differential pressure | ||||||
|  |       oversampling: 1024x | ||||||
|   | |||||||
| @@ -1,7 +1,4 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: ${pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: yashima |   - platform: yashima | ||||||
|     name: Yashima Climate |     name: Yashima Climate | ||||||
|  |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-c3-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO5 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,7 +1,4 @@ | |||||||
| remote_transmitter: |  | ||||||
|   pin: ${pin} |  | ||||||
|   carrier_duty_percent: 50% |  | ||||||
|  |  | ||||||
| climate: | climate: | ||||||
|   - platform: zhlt01 |   - platform: zhlt01 | ||||||
|     name: ZH/LT-01 Climate |     name: ZH/LT-01 Climate | ||||||
|  |     transmitter_id: xmitr | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-c3-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO2 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| substitutions: | packages: | ||||||
|   pin: GPIO5 |   remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp8266-ard.yaml | ||||||
|  |  | ||||||
| <<: !include common.yaml | <<: !include common.yaml | ||||||
|   | |||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user