esphome 2024.6.6__py3-none-any.whl → 2024.7.0b1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. esphome/components/cover/cover.h +2 -2
  2. esphome/components/esp32_camera/__init__.py +6 -3
  3. esphome/components/ethernet/ethernet_component.cpp +3 -2
  4. esphome/components/font/__init__.py +2 -28
  5. esphome/components/haier/binary_sensor/__init__.py +4 -4
  6. esphome/components/haier/button/__init__.py +1 -1
  7. esphome/components/haier/climate.py +43 -9
  8. esphome/components/haier/haier_base.cpp +4 -0
  9. esphome/components/haier/haier_base.h +11 -1
  10. esphome/components/haier/hon_climate.cpp +109 -55
  11. esphome/components/haier/hon_climate.h +7 -1
  12. esphome/components/haier/hon_packet.h +5 -0
  13. esphome/components/haier/sensor/__init__.py +5 -5
  14. esphome/components/haier/smartair2_climate.cpp +1 -0
  15. esphome/components/haier/text_sensor/__init__.py +4 -4
  16. esphome/components/heatpumpir/climate.py +8 -2
  17. esphome/components/heatpumpir/heatpumpir.cpp +6 -0
  18. esphome/components/heatpumpir/heatpumpir.h +6 -0
  19. esphome/components/http_request/update/http_request_update.cpp +6 -7
  20. esphome/components/http_request/update/http_request_update.h +0 -3
  21. esphome/components/image/__init__.py +2 -29
  22. esphome/components/improv_serial/improv_serial_component.cpp +8 -8
  23. esphome/components/mdns/__init__.py +3 -3
  24. esphome/components/mdns/mdns_component.cpp +3 -1
  25. esphome/components/mdns/mdns_component.h +3 -1
  26. esphome/components/mdns/mdns_esp32.cpp +2 -1
  27. esphome/components/mdns/mdns_esp8266.cpp +2 -1
  28. esphome/components/mdns/mdns_host.cpp +2 -1
  29. esphome/components/mdns/mdns_libretiny.cpp +2 -1
  30. esphome/components/mdns/mdns_rp2040.cpp +2 -1
  31. esphome/components/micro_wake_word/__init__.py +203 -56
  32. esphome/components/micro_wake_word/micro_wake_word.cpp +225 -275
  33. esphome/components/micro_wake_word/micro_wake_word.h +77 -107
  34. esphome/components/micro_wake_word/preprocessor_settings.h +20 -0
  35. esphome/components/micro_wake_word/streaming_model.cpp +189 -0
  36. esphome/components/micro_wake_word/streaming_model.h +84 -0
  37. esphome/components/modbus_controller/text_sensor/__init__.py +2 -1
  38. esphome/components/modbus_controller/text_sensor/modbus_textsensor.cpp +4 -1
  39. esphome/components/modbus_controller/text_sensor/modbus_textsensor.h +1 -1
  40. esphome/components/number/__init__.py +2 -0
  41. esphome/components/qspi_amoled/display.py +16 -4
  42. esphome/components/qspi_amoled/qspi_amoled.cpp +16 -0
  43. esphome/components/qspi_amoled/qspi_amoled.h +0 -3
  44. esphome/components/remote_base/dooya_protocol.cpp +4 -4
  45. esphome/components/remote_base/rc_switch_protocol.cpp +1 -1
  46. esphome/components/script/__init__.py +1 -1
  47. esphome/components/sensor/__init__.py +2 -0
  48. esphome/components/tuya/tuya.cpp +8 -2
  49. esphome/components/tuya/tuya.h +3 -1
  50. esphome/components/uart/__init__.py +72 -9
  51. esphome/components/uart/uart_component_esp32_arduino.cpp +18 -4
  52. esphome/components/uart/uart_component_esp_idf.cpp +22 -2
  53. esphome/components/uart/uart_component_host.cpp +295 -0
  54. esphome/components/uart/uart_component_host.h +38 -0
  55. esphome/components/uptime/sensor.py +44 -11
  56. esphome/components/uptime/{uptime_sensor.cpp → uptime_seconds_sensor.cpp} +11 -7
  57. esphome/components/uptime/{uptime_sensor.h → uptime_seconds_sensor.h} +2 -2
  58. esphome/components/uptime/uptime_timestamp_sensor.cpp +39 -0
  59. esphome/components/uptime/uptime_timestamp_sensor.h +30 -0
  60. esphome/components/veml7700/veml7700.cpp +1 -1
  61. esphome/components/veml7700/veml7700.h +5 -5
  62. esphome/components/voice_assistant/voice_assistant.cpp +1 -1
  63. esphome/components/wifi/wifi_component_esp_idf.cpp +1 -1
  64. esphome/components/wifi/wifi_component_pico_w.cpp +18 -2
  65. esphome/components/wireguard/__init__.py +1 -1
  66. esphome/components/x9c/output.py +7 -1
  67. esphome/const.py +2 -1
  68. esphome/core/defines.h +1 -0
  69. esphome/core/helpers.cpp +1 -1
  70. esphome/core/helpers.h +1 -1
  71. esphome/external_files.py +26 -0
  72. {esphome-2024.6.6.dist-info → esphome-2024.7.0b1.dist-info}/METADATA +1 -1
  73. {esphome-2024.6.6.dist-info → esphome-2024.7.0b1.dist-info}/RECORD +77 -71
  74. esphome/components/micro_wake_word/audio_preprocessor_int8_model_data.h +0 -493
  75. {esphome-2024.6.6.dist-info → esphome-2024.7.0b1.dist-info}/LICENSE +0 -0
  76. {esphome-2024.6.6.dist-info → esphome-2024.7.0b1.dist-info}/WHEEL +0 -0
  77. {esphome-2024.6.6.dist-info → esphome-2024.7.0b1.dist-info}/entry_points.txt +0 -0
  78. {esphome-2024.6.6.dist-info → esphome-2024.7.0b1.dist-info}/top_level.txt +0 -0
@@ -37,6 +37,7 @@ haier_protocol::HandlerError Smartair2Climate::status_handler_(haier_protocol::F
37
37
  } else {
38
38
  if (data_size >= sizeof(smartair2_protocol::HaierPacketControl) + 2) {
39
39
  memcpy(this->last_status_message_.get(), data + 2, sizeof(smartair2_protocol::HaierPacketControl));
40
+ this->status_message_callback_.call((const char *) data, data_size);
40
41
  } else {
41
42
  ESP_LOGW(TAG, "Status packet too small: %d (should be >= %d)", data_size,
42
43
  sizeof(smartair2_protocol::HaierPacketControl));
@@ -39,7 +39,7 @@ TEXT_SENSOR_TYPES = {
39
39
 
40
40
  CONFIG_SCHEMA = cv.Schema(
41
41
  {
42
- cv.Required(CONF_HAIER_ID): cv.use_id(HonClimate),
42
+ cv.GenerateID(CONF_HAIER_ID): cv.use_id(HonClimate),
43
43
  }
44
44
  ).extend({cv.Optional(type): schema for type, schema in TEXT_SENSOR_TYPES.items()})
45
45
 
@@ -47,8 +47,8 @@ CONFIG_SCHEMA = cv.Schema(
47
47
  async def to_code(config):
48
48
  paren = await cg.get_variable(config[CONF_HAIER_ID])
49
49
 
50
- for type, _ in TEXT_SENSOR_TYPES.items():
51
- if conf := config.get(type):
50
+ for type_ in TEXT_SENSOR_TYPES:
51
+ if conf := config.get(type_):
52
52
  sens = await text_sensor.new_text_sensor(conf)
53
- text_sensor_type = getattr(TextSensorTypeEnum, type.upper())
53
+ text_sensor_type = getattr(TextSensorTypeEnum, type_.upper())
54
54
  cg.add(paren.set_sub_text_sensor(text_sensor_type, sens))
@@ -34,6 +34,7 @@ PROTOCOLS = {
34
34
  "greeyan": Protocol.PROTOCOL_GREEYAN,
35
35
  "greeyac": Protocol.PROTOCOL_GREEYAC,
36
36
  "greeyt": Protocol.PROTOCOL_GREEYT,
37
+ "greeyap": Protocol.PROTOCOL_GREEYAP,
37
38
  "hisense_aud": Protocol.PROTOCOL_HISENSE_AUD,
38
39
  "hitachi": Protocol.PROTOCOL_HITACHI,
39
40
  "hyundai": Protocol.PROTOCOL_HYUNDAI,
@@ -61,6 +62,11 @@ PROTOCOLS = {
61
62
  "toshiba_daiseikai": Protocol.PROTOCOL_TOSHIBA_DAISEIKAI,
62
63
  "toshiba": Protocol.PROTOCOL_TOSHIBA,
63
64
  "zhlt01": Protocol.PROTOCOL_ZHLT01,
65
+ "nibe": Protocol.PROTOCOL_NIBE,
66
+ "carrier_qlima_1": Protocol.PROTOCOL_QLIMA_1,
67
+ "carrier_qlima_2": Protocol.PROTOCOL_QLIMA_2,
68
+ "samsung_aqv12msan": Protocol.PROTOCOL_SAMSUNG_AQV12MSAN,
69
+ "zhjg01": Protocol.PROTOCOL_ZHJG01,
64
70
  }
65
71
 
66
72
  CONF_HORIZONTAL_DEFAULT = "horizontal_default"
@@ -116,7 +122,7 @@ def to_code(config):
116
122
  cg.add(var.set_max_temperature(config[CONF_MAX_TEMPERATURE]))
117
123
  cg.add(var.set_min_temperature(config[CONF_MIN_TEMPERATURE]))
118
124
 
119
- cg.add_library("tonia/HeatpumpIR", "1.0.23")
125
+ cg.add_library("tonia/HeatpumpIR", "1.0.26")
120
126
 
121
127
  if CORE.is_esp8266 or CORE.is_esp32:
122
- cg.add_library("crankyoldgit/IRremoteESP8266", "2.8.4")
128
+ cg.add_library("crankyoldgit/IRremoteESP8266", "2.8.6")
@@ -28,6 +28,7 @@ const std::map<Protocol, std::function<HeatpumpIR *()>> PROTOCOL_CONSTRUCTOR_MAP
28
28
  {PROTOCOL_GREEYAN, []() { return new GreeYANHeatpumpIR(); }}, // NOLINT
29
29
  {PROTOCOL_GREEYAC, []() { return new GreeYACHeatpumpIR(); }}, // NOLINT
30
30
  {PROTOCOL_GREEYT, []() { return new GreeYTHeatpumpIR(); }}, // NOLINT
31
+ {PROTOCOL_GREEYAP, []() { return new GreeYAPHeatpumpIR(); }}, // NOLINT
31
32
  {PROTOCOL_HISENSE_AUD, []() { return new HisenseHeatpumpIR(); }}, // NOLINT
32
33
  {PROTOCOL_HITACHI, []() { return new HitachiHeatpumpIR(); }}, // NOLINT
33
34
  {PROTOCOL_HYUNDAI, []() { return new HyundaiHeatpumpIR(); }}, // NOLINT
@@ -55,6 +56,11 @@ const std::map<Protocol, std::function<HeatpumpIR *()>> PROTOCOL_CONSTRUCTOR_MAP
55
56
  {PROTOCOL_TOSHIBA_DAISEIKAI, []() { return new ToshibaDaiseikaiHeatpumpIR(); }}, // NOLINT
56
57
  {PROTOCOL_TOSHIBA, []() { return new ToshibaHeatpumpIR(); }}, // NOLINT
57
58
  {PROTOCOL_ZHLT01, []() { return new ZHLT01HeatpumpIR(); }}, // NOLINT
59
+ {PROTOCOL_NIBE, []() { return new NibeHeatpumpIR(); }}, // NOLINT
60
+ {PROTOCOL_QLIMA_1, []() { return new Qlima1HeatpumpIR(); }}, // NOLINT
61
+ {PROTOCOL_QLIMA_2, []() { return new Qlima2HeatpumpIR(); }}, // NOLINT
62
+ {PROTOCOL_SAMSUNG_AQV12MSAN, []() { return new SamsungAQV12MSANHeatpumpIR(); }}, // NOLINT
63
+ {PROTOCOL_ZHJG01, []() { return new ZHJG01HeatpumpIR(); }}, // NOLINT
58
64
  };
59
65
 
60
66
  void HeatpumpIRClimate::setup() {
@@ -28,6 +28,7 @@ enum Protocol {
28
28
  PROTOCOL_GREEYAN,
29
29
  PROTOCOL_GREEYAC,
30
30
  PROTOCOL_GREEYT,
31
+ PROTOCOL_GREEYAP,
31
32
  PROTOCOL_HISENSE_AUD,
32
33
  PROTOCOL_HITACHI,
33
34
  PROTOCOL_HYUNDAI,
@@ -55,6 +56,11 @@ enum Protocol {
55
56
  PROTOCOL_TOSHIBA_DAISEIKAI,
56
57
  PROTOCOL_TOSHIBA,
57
58
  PROTOCOL_ZHLT01,
59
+ PROTOCOL_NIBE,
60
+ PROTOCOL_QLIMA_1,
61
+ PROTOCOL_QLIMA_2,
62
+ PROTOCOL_SAMSUNG_AQV12MSAN,
63
+ PROTOCOL_ZHJG01,
58
64
  };
59
65
 
60
66
  // Simple enum to represent horizontal directios
@@ -116,19 +116,18 @@ void HttpRequestUpdate::update() {
116
116
  }
117
117
  }
118
118
 
119
- std::string current_version = this->current_version_;
120
- if (current_version.empty()) {
119
+ std::string current_version;
121
120
  #ifdef ESPHOME_PROJECT_VERSION
122
- current_version = ESPHOME_PROJECT_VERSION;
121
+ current_version = ESPHOME_PROJECT_VERSION;
123
122
  #else
124
- current_version = ESPHOME_VERSION;
123
+ current_version = ESPHOME_VERSION;
125
124
  #endif
126
- }
125
+
127
126
  this->update_info_.current_version = current_version;
128
127
 
129
- if (this->update_info_.latest_version.empty()) {
128
+ if (this->update_info_.latest_version.empty() || this->update_info_.latest_version == update_info_.current_version) {
130
129
  this->state_ = update::UPDATE_STATE_NO_UPDATE;
131
- } else if (this->update_info_.latest_version != this->current_version_) {
130
+ } else {
132
131
  this->state_ = update::UPDATE_STATE_AVAILABLE;
133
132
  }
134
133
 
@@ -22,15 +22,12 @@ class HttpRequestUpdate : public update::UpdateEntity, public PollingComponent {
22
22
  void set_request_parent(HttpRequestComponent *request_parent) { this->request_parent_ = request_parent; }
23
23
  void set_ota_parent(OtaHttpRequestComponent *ota_parent) { this->ota_parent_ = ota_parent; }
24
24
 
25
- void set_current_version(const std::string &current_version) { this->current_version_ = current_version; }
26
-
27
25
  float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
28
26
 
29
27
  protected:
30
28
  HttpRequestComponent *request_parent_;
31
29
  OtaHttpRequestComponent *ota_parent_;
32
30
  std::string source_url_;
33
- std::string current_version_{""};
34
31
  };
35
32
 
36
33
  } // namespace http_request
@@ -6,7 +6,6 @@ import hashlib
6
6
  import io
7
7
  from pathlib import Path
8
8
  import re
9
- import requests
10
9
  from magic import Magic
11
10
 
12
11
  from esphome import core
@@ -15,7 +14,6 @@ from esphome import external_files
15
14
  import esphome.config_validation as cv
16
15
  import esphome.codegen as cg
17
16
  from esphome.const import (
18
- __version__,
19
17
  CONF_DITHER,
20
18
  CONF_FILE,
21
19
  CONF_ICON,
@@ -75,31 +73,6 @@ def compute_local_image_path(value: dict) -> Path:
75
73
  return base_dir / key
76
74
 
77
75
 
78
- def download_content(url: str, path: Path) -> None:
79
- if not external_files.has_remote_file_changed(url, path):
80
- _LOGGER.debug("Remote file has not changed %s", url)
81
- return
82
-
83
- _LOGGER.debug(
84
- "Remote file has changed, downloading from %s to %s",
85
- url,
86
- path,
87
- )
88
-
89
- try:
90
- req = requests.get(
91
- url,
92
- timeout=IMAGE_DOWNLOAD_TIMEOUT,
93
- headers={"User-agent": f"ESPHome/{__version__} (https://esphome.io)"},
94
- )
95
- req.raise_for_status()
96
- except requests.exceptions.RequestException as e:
97
- raise cv.Invalid(f"Could not download from {url}: {e}")
98
-
99
- path.parent.mkdir(parents=True, exist_ok=True)
100
- path.write_bytes(req.content)
101
-
102
-
103
76
  def download_mdi(value):
104
77
  validate_cairosvg_installed(value)
105
78
 
@@ -108,7 +81,7 @@ def download_mdi(value):
108
81
 
109
82
  url = f"https://raw.githubusercontent.com/Templarian/MaterialDesign/master/svg/{mdi_id}.svg"
110
83
 
111
- download_content(url, path)
84
+ external_files.download_content(url, path, IMAGE_DOWNLOAD_TIMEOUT)
112
85
 
113
86
  return value
114
87
 
@@ -117,7 +90,7 @@ def download_image(value):
117
90
  url = value[CONF_URL]
118
91
  path = compute_local_image_path(value)
119
92
 
120
- download_content(url, path)
93
+ external_files.download_content(url, path, IMAGE_DOWNLOAD_TIMEOUT)
121
94
 
122
95
  return value
123
96
 
@@ -57,7 +57,7 @@ optional<uint8_t> ImprovSerialComponent::read_byte_() {
57
57
  }
58
58
  }
59
59
  break;
60
- #if defined(CONFIG_ESP_CONSOLE_USB_CDC) && (defined(USE_ESP32_VARIANT_ESP32S2) || defined(USE_ESP32_VARIANT_ESP32S3))
60
+ #ifdef USE_LOGGER_USB_CDC
61
61
  case logger::UART_SELECTION_USB_CDC:
62
62
  #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
63
63
  if (esp_usb_console_available_for_read()) {
@@ -68,15 +68,15 @@ optional<uint8_t> ImprovSerialComponent::read_byte_() {
68
68
  byte = data;
69
69
  }
70
70
  break;
71
- #endif // USE_ESP32_VARIANT_ESP32S2 || USE_ESP32_VARIANT_ESP32S3
72
- #if defined(USE_ESP32_VARIANT_ESP32C3) || defined(USE_ESP32_VARIANT_ESP32C6) || defined(USE_ESP32_VARIANT_ESP32S3)
71
+ #endif // USE_LOGGER_USB_CDC
72
+ #ifdef USE_LOGGER_USB_SERIAL_JTAG
73
73
  case logger::UART_SELECTION_USB_SERIAL_JTAG: {
74
74
  if (usb_serial_jtag_read_bytes((char *) &data, 1, 0)) {
75
75
  byte = data;
76
76
  }
77
77
  break;
78
78
  }
79
- #endif // USE_ESP32_VARIANT_ESP32C3 || USE_ESP32_VARIANT_ESP32C6 || USE_ESP32_VARIANT_ESP32S3
79
+ #endif // USE_LOGGER_USB_SERIAL_JTAG
80
80
  default:
81
81
  break;
82
82
  }
@@ -99,19 +99,19 @@ void ImprovSerialComponent::write_data_(std::vector<uint8_t> &data) {
99
99
  #endif // !USE_ESP32_VARIANT_ESP32C3 && !USE_ESP32_VARIANT_ESP32S2 && !USE_ESP32_VARIANT_ESP32S3
100
100
  uart_write_bytes(this->uart_num_, data.data(), data.size());
101
101
  break;
102
- #if defined(CONFIG_ESP_CONSOLE_USB_CDC) && (defined(USE_ESP32_VARIANT_ESP32S2) || defined(USE_ESP32_VARIANT_ESP32S3))
102
+ #ifdef USE_LOGGER_USB_CDC
103
103
  case logger::UART_SELECTION_USB_CDC: {
104
104
  const char *msg = (char *) data.data();
105
105
  esp_usb_console_write_buf(msg, data.size());
106
106
  break;
107
107
  }
108
- #endif // USE_ESP32_VARIANT_ESP32S2 || USE_ESP32_VARIANT_ESP32S3
109
- #if defined(USE_ESP32_VARIANT_ESP32C3) || defined(USE_ESP32_VARIANT_ESP32C6) || defined(USE_ESP32_VARIANT_ESP32S3)
108
+ #endif // USE_LOGGER_USB_CDC
109
+ #ifdef USE_LOGGER_USB_SERIAL_JTAG
110
110
  case logger::UART_SELECTION_USB_SERIAL_JTAG:
111
111
  usb_serial_jtag_write_bytes((char *) data.data(), data.size(), 20 / portTICK_PERIOD_MS);
112
112
  usb_serial_jtag_ll_txfifo_flush(); // fixes for issue in IDF 4.4.7
113
113
  break;
114
- #endif // USE_ESP32_VARIANT_ESP32C3 || USE_ESP32_VARIANT_ESP32S3
114
+ #endif // USE_LOGGER_USB_SERIAL_JTAG
115
115
  default:
116
116
  break;
117
117
  }
@@ -74,6 +74,9 @@ def mdns_service(
74
74
 
75
75
  @coroutine_with_priority(55.0)
76
76
  async def to_code(config):
77
+ if config[CONF_DISABLED] is True:
78
+ return
79
+
77
80
  if CORE.using_arduino:
78
81
  if CORE.is_esp32:
79
82
  cg.add_library("ESPmDNS", None)
@@ -92,9 +95,6 @@ async def to_code(config):
92
95
  path="components/mdns",
93
96
  )
94
97
 
95
- if config[CONF_DISABLED]:
96
- return
97
-
98
98
  cg.add_define("USE_MDNS")
99
99
 
100
100
  var = cg.new_Pvariable(config[CONF_ID])
@@ -1,5 +1,6 @@
1
- #include "mdns_component.h"
2
1
  #include "esphome/core/defines.h"
2
+ #ifdef USE_MDNS
3
+ #include "mdns_component.h"
3
4
  #include "esphome/core/version.h"
4
5
  #include "esphome/core/application.h"
5
6
  #include "esphome/core/log.h"
@@ -125,3 +126,4 @@ void MDNSComponent::dump_config() {
125
126
 
126
127
  } // namespace mdns
127
128
  } // namespace esphome
129
+ #endif
@@ -1,5 +1,6 @@
1
1
  #pragma once
2
-
2
+ #include "esphome/core/defines.h"
3
+ #ifdef USE_MDNS
3
4
  #include <string>
4
5
  #include <vector>
5
6
  #include "esphome/core/component.h"
@@ -46,3 +47,4 @@ class MDNSComponent : public Component {
46
47
 
47
48
  } // namespace mdns
48
49
  } // namespace esphome
50
+ #endif
@@ -1,4 +1,5 @@
1
- #ifdef USE_ESP32
1
+ #include "esphome/core/defines.h"
2
+ #if defined(USE_ESP32) && defined(USE_MDNS)
2
3
 
3
4
  #include <mdns.h>
4
5
  #include <cstring>
@@ -1,4 +1,5 @@
1
- #if defined(USE_ESP8266) && defined(USE_ARDUINO)
1
+ #include "esphome/core/defines.h"
2
+ #if defined(USE_ESP8266) && defined(USE_ARDUINO) && defined(USE_MDNS)
2
3
 
3
4
  #include <ESP8266mDNS.h>
4
5
  #include "esphome/components/network/ip_address.h"
@@ -1,4 +1,5 @@
1
- #ifdef USE_HOST
1
+ #include "esphome/core/defines.h"
2
+ #if defined(USE_HOST) && defined(USE_MDNS)
2
3
 
3
4
  #include "esphome/components/network/ip_address.h"
4
5
  #include "esphome/components/network/util.h"
@@ -1,4 +1,5 @@
1
- #ifdef USE_LIBRETINY
1
+ #include "esphome/core/defines.h"
2
+ #if defined(USE_LIBRETINY) && defined(USE_MDNS)
2
3
 
3
4
  #include "esphome/components/network/ip_address.h"
4
5
  #include "esphome/components/network/util.h"
@@ -1,4 +1,5 @@
1
- #ifdef USE_RP2040
1
+ #include "esphome/core/defines.h"
2
+ #if defined(USE_RP2040) && defined(USE_MDNS)
2
3
 
3
4
  #include "esphome/components/network/ip_address.h"
4
5
  #include "esphome/components/network/util.h"