esphome 2025.5.0b2__py3-none-any.whl → 2025.5.0b4__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 (104) hide show
  1. esphome/__main__.py +16 -14
  2. esphome/components/api/api_connection.cpp +339 -652
  3. esphome/components/api/api_connection.h +251 -57
  4. esphome/components/api/api_frame_helper.cpp +136 -49
  5. esphome/components/api/api_frame_helper.h +49 -6
  6. esphome/components/api/proto.h +48 -8
  7. esphome/components/ballu/climate.py +1 -1
  8. esphome/components/bedjet/bedjet_hub.cpp +1 -0
  9. esphome/components/binary_sensor/binary_sensor.cpp +10 -6
  10. esphome/components/binary_sensor/binary_sensor.h +1 -1
  11. esphome/components/binary_sensor/filter.cpp +21 -21
  12. esphome/components/binary_sensor/filter.h +10 -10
  13. esphome/components/bluetooth_proxy/bluetooth_proxy.cpp +2 -1
  14. esphome/components/ccs811/sensor.py +9 -6
  15. esphome/components/climate_ir/__init__.py +3 -3
  16. esphome/components/climate_ir_lg/climate.py +1 -1
  17. esphome/components/coolix/climate.py +1 -1
  18. esphome/components/cse7766/cse7766.cpp +2 -1
  19. esphome/components/current_based/current_based_cover.cpp +2 -1
  20. esphome/components/daikin/climate.py +1 -1
  21. esphome/components/daikin_arc/climate.py +1 -1
  22. esphome/components/daikin_brc/climate.py +1 -1
  23. esphome/components/daly_bms/daly_bms.cpp +2 -1
  24. esphome/components/debug/debug_component.cpp +1 -1
  25. esphome/components/delonghi/climate.py +1 -1
  26. esphome/components/dps310/sensor.py +6 -6
  27. esphome/components/ee895/sensor.py +9 -9
  28. esphome/components/emmeti/climate.py +1 -1
  29. esphome/components/endstop/endstop_cover.cpp +2 -1
  30. esphome/components/ens160_base/__init__.py +12 -9
  31. esphome/components/esp32_ble/ble_advertising.cpp +2 -1
  32. esphome/components/esp32_camera/__init__.py +1 -1
  33. esphome/components/esp32_camera/esp32_camera.cpp +2 -10
  34. esphome/components/esp32_camera/esp32_camera.h +1 -1
  35. esphome/components/esp32_improv/esp32_improv_component.cpp +1 -1
  36. esphome/components/esp32_touch/esp32_touch.cpp +1 -1
  37. esphome/components/ethernet/ethernet_component.cpp +1 -1
  38. esphome/components/feedback/feedback_cover.cpp +2 -1
  39. esphome/components/fujitsu_general/climate.py +1 -1
  40. esphome/components/gcja5/gcja5.cpp +2 -1
  41. esphome/components/gps/__init__.py +37 -16
  42. esphome/components/gps/gps.cpp +33 -17
  43. esphome/components/gps/gps.h +16 -15
  44. esphome/components/gree/climate.py +1 -1
  45. esphome/components/growatt_solar/growatt_solar.cpp +2 -1
  46. esphome/components/heatpumpir/climate.py +1 -1
  47. esphome/components/hitachi_ac344/climate.py +1 -1
  48. esphome/components/hitachi_ac424/climate.py +1 -1
  49. esphome/components/hte501/sensor.py +6 -6
  50. esphome/components/hyt271/sensor.py +6 -6
  51. esphome/components/kuntze/kuntze.cpp +2 -1
  52. esphome/components/logger/__init__.py +1 -0
  53. esphome/components/logger/logger.cpp +53 -32
  54. esphome/components/logger/logger.h +55 -5
  55. esphome/components/matrix_keypad/matrix_keypad.cpp +2 -1
  56. esphome/components/max7219digit/max7219digit.cpp +2 -1
  57. esphome/components/mhz19/sensor.py +11 -7
  58. esphome/components/midea_ir/climate.py +1 -1
  59. esphome/components/mitsubishi/climate.py +1 -1
  60. esphome/components/modbus/modbus.cpp +2 -1
  61. esphome/components/mqtt/mqtt_client.cpp +1 -1
  62. esphome/components/ms5611/sensor.py +6 -6
  63. esphome/components/ms8607/sensor.py +3 -3
  64. esphome/components/noblex/climate.py +1 -1
  65. esphome/components/pmsx003/pmsx003.cpp +2 -1
  66. esphome/components/pzem004t/pzem004t.cpp +2 -1
  67. esphome/components/rf_bridge/rf_bridge.cpp +2 -1
  68. esphome/components/sds011/sds011.cpp +2 -1
  69. esphome/components/sen5x/sen5x.cpp +55 -36
  70. esphome/components/senseair/sensor.py +3 -3
  71. esphome/components/sgp30/sensor.py +14 -16
  72. esphome/components/shtcx/sensor.py +6 -6
  73. esphome/components/slow_pwm/slow_pwm_output.cpp +2 -1
  74. esphome/components/sprinkler/sprinkler.cpp +6 -5
  75. esphome/components/t6615/sensor.py +3 -3
  76. esphome/components/t6615/t6615.cpp +2 -1
  77. esphome/components/tcl112/climate.py +1 -1
  78. esphome/components/time_based/time_based_cover.cpp +2 -1
  79. esphome/components/toshiba/climate.py +1 -1
  80. esphome/components/uart/switch/uart_switch.cpp +2 -1
  81. esphome/components/uponor_smatrix/climate/uponor_smatrix_climate.cpp +2 -1
  82. esphome/components/uponor_smatrix/uponor_smatrix.cpp +2 -1
  83. esphome/components/weikai/weikai.cpp +0 -52
  84. esphome/components/whirlpool/climate.py +1 -1
  85. esphome/components/whynter/climate.py +1 -1
  86. esphome/components/zhlt01/climate.py +1 -1
  87. esphome/config.py +13 -13
  88. esphome/const.py +1 -1
  89. esphome/core/application.cpp +26 -10
  90. esphome/core/application.h +5 -1
  91. esphome/core/component.cpp +10 -5
  92. esphome/core/component.h +5 -1
  93. esphome/core/doxygen.h +13 -0
  94. esphome/core/scheduler.cpp +4 -1
  95. esphome/log.py +15 -19
  96. esphome/mqtt.py +2 -2
  97. esphome/voluptuous_schema.py +3 -1
  98. esphome/wizard.py +45 -35
  99. {esphome-2025.5.0b2.dist-info → esphome-2025.5.0b4.dist-info}/METADATA +1 -1
  100. {esphome-2025.5.0b2.dist-info → esphome-2025.5.0b4.dist-info}/RECORD +104 -103
  101. {esphome-2025.5.0b2.dist-info → esphome-2025.5.0b4.dist-info}/WHEEL +0 -0
  102. {esphome-2025.5.0b2.dist-info → esphome-2025.5.0b4.dist-info}/entry_points.txt +0 -0
  103. {esphome-2025.5.0b2.dist-info → esphome-2025.5.0b4.dist-info}/licenses/LICENSE +0 -0
  104. {esphome-2025.5.0b2.dist-info → esphome-2025.5.0b4.dist-info}/top_level.txt +0 -0
esphome/wizard.py CHANGED
@@ -9,7 +9,7 @@ import esphome.config_validation as cv
9
9
  from esphome.const import ALLOWED_NAME_CHARS, ENV_QUICKWIZARD
10
10
  from esphome.core import CORE
11
11
  from esphome.helpers import get_bool_env, write_file
12
- from esphome.log import Fore, color
12
+ from esphome.log import AnsiFore, color
13
13
  from esphome.storage_json import StorageJSON, ext_storage_path
14
14
  from esphome.util import safe_input, safe_print
15
15
 
@@ -219,7 +219,7 @@ def wizard_write(path, **kwargs):
219
219
  elif board in rtl87xx_boards.BOARDS:
220
220
  platform = "RTL87XX"
221
221
  else:
222
- safe_print(color(Fore.RED, f'The board "{board}" is unknown.'))
222
+ safe_print(color(AnsiFore.RED, f'The board "{board}" is unknown.'))
223
223
  return False
224
224
  kwargs["platform"] = platform
225
225
  hardware = kwargs["platform"]
@@ -274,12 +274,12 @@ def wizard(path):
274
274
 
275
275
  if not path.endswith(".yaml") and not path.endswith(".yml"):
276
276
  safe_print(
277
- f"Please make your configuration file {color(Fore.CYAN, path)} have the extension .yaml or .yml"
277
+ f"Please make your configuration file {color(AnsiFore.CYAN, path)} have the extension .yaml or .yml"
278
278
  )
279
279
  return 1
280
280
  if os.path.exists(path):
281
281
  safe_print(
282
- f"Uh oh, it seems like {color(Fore.CYAN, path)} already exists, please delete that file first or chose another configuration file."
282
+ f"Uh oh, it seems like {color(AnsiFore.CYAN, path)} already exists, please delete that file first or chose another configuration file."
283
283
  )
284
284
  return 2
285
285
 
@@ -298,17 +298,19 @@ def wizard(path):
298
298
  sleep(3.0)
299
299
  safe_print()
300
300
  safe_print_step(1, CORE_BIG)
301
- safe_print(f"First up, please choose a {color(Fore.GREEN, 'name')} for your node.")
301
+ safe_print(
302
+ f"First up, please choose a {color(AnsiFore.GREEN, 'name')} for your node."
303
+ )
302
304
  safe_print(
303
305
  "It should be a unique name that can be used to identify the device later."
304
306
  )
305
307
  sleep(1)
306
308
  safe_print(
307
- f"For example, I like calling the node in my living room {color(Fore.BOLD_WHITE, 'livingroom')}."
309
+ f"For example, I like calling the node in my living room {color(AnsiFore.BOLD_WHITE, 'livingroom')}."
308
310
  )
309
311
  safe_print()
310
312
  sleep(1)
311
- name = safe_input(color(Fore.BOLD_WHITE, "(name): "))
313
+ name = safe_input(color(AnsiFore.BOLD_WHITE, "(name): "))
312
314
 
313
315
  while True:
314
316
  try:
@@ -317,7 +319,7 @@ def wizard(path):
317
319
  except vol.Invalid:
318
320
  safe_print(
319
321
  color(
320
- Fore.RED,
322
+ AnsiFore.RED,
321
323
  f'Oh noes, "{name}" isn\'t a valid name. Names can only '
322
324
  f"include numbers, lower-case letters and hyphens. ",
323
325
  )
@@ -325,11 +327,13 @@ def wizard(path):
325
327
  name = strip_accents(name).lower().replace(" ", "-")
326
328
  name = strip_accents(name).lower().replace("_", "-")
327
329
  name = "".join(c for c in name if c in ALLOWED_NAME_CHARS)
328
- safe_print(f'Shall I use "{color(Fore.CYAN, name)}" as the name instead?')
330
+ safe_print(
331
+ f'Shall I use "{color(AnsiFore.CYAN, name)}" as the name instead?'
332
+ )
329
333
  sleep(0.5)
330
334
  name = default_input("(name [{}]): ", name)
331
335
 
332
- safe_print(f'Great! Your node is now called "{color(Fore.CYAN, name)}".')
336
+ safe_print(f'Great! Your node is now called "{color(AnsiFore.CYAN, name)}".')
333
337
  sleep(1)
334
338
  safe_print_step(2, ESP_BIG)
335
339
  safe_print(
@@ -346,7 +350,7 @@ def wizard(path):
346
350
  sleep(0.5)
347
351
  safe_print()
348
352
  platform = safe_input(
349
- color(Fore.BOLD_WHITE, f"({'/'.join(wizard_platforms)}): ")
353
+ color(AnsiFore.BOLD_WHITE, f"({'/'.join(wizard_platforms)}): ")
350
354
  )
351
355
  try:
352
356
  platform = vol.All(vol.Upper, vol.Any(*wizard_platforms))(platform.upper())
@@ -355,7 +359,9 @@ def wizard(path):
355
359
  safe_print(
356
360
  f'Unfortunately, I can\'t find an espressif microcontroller called "{platform}". Please try again.'
357
361
  )
358
- safe_print(f"Thanks! You've chosen {color(Fore.CYAN, platform)} as your platform.")
362
+ safe_print(
363
+ f"Thanks! You've chosen {color(AnsiFore.CYAN, platform)} as your platform."
364
+ )
359
365
  safe_print()
360
366
  sleep(1)
361
367
 
@@ -376,27 +382,29 @@ def wizard(path):
376
382
  else:
377
383
  raise NotImplementedError("Unknown platform!")
378
384
 
379
- safe_print(f"Next, I need to know what {color(Fore.GREEN, 'board')} you're using.")
385
+ safe_print(
386
+ f"Next, I need to know what {color(AnsiFore.GREEN, 'board')} you're using."
387
+ )
380
388
  sleep(0.5)
381
- safe_print(f"Please go to {color(Fore.GREEN, board_link)} and choose a board.")
389
+ safe_print(f"Please go to {color(AnsiFore.GREEN, board_link)} and choose a board.")
382
390
  if platform == "ESP32":
383
- safe_print(f"(Type {color(Fore.GREEN, 'esp01_1m')} for Sonoff devices)")
391
+ safe_print(f"(Type {color(AnsiFore.GREEN, 'esp01_1m')} for Sonoff devices)")
384
392
  safe_print()
385
393
  # Don't sleep because user needs to copy link
386
394
  if platform == "ESP32":
387
- safe_print(f'For example "{color(Fore.BOLD_WHITE, "nodemcu-32s")}".')
395
+ safe_print(f'For example "{color(AnsiFore.BOLD_WHITE, "nodemcu-32s")}".')
388
396
  boards_list = esp32_boards.BOARDS.items()
389
397
  elif platform == "ESP8266":
390
- safe_print(f'For example "{color(Fore.BOLD_WHITE, "nodemcuv2")}".')
398
+ safe_print(f'For example "{color(AnsiFore.BOLD_WHITE, "nodemcuv2")}".')
391
399
  boards_list = esp8266_boards.BOARDS.items()
392
400
  elif platform == "BK72XX":
393
- safe_print(f'For example "{color(Fore.BOLD_WHITE, "cb2s")}".')
401
+ safe_print(f'For example "{color(AnsiFore.BOLD_WHITE, "cb2s")}".')
394
402
  boards_list = bk72xx_boards.BOARDS.items()
395
403
  elif platform == "RTL87XX":
396
- safe_print(f'For example "{color(Fore.BOLD_WHITE, "wr3")}".')
404
+ safe_print(f'For example "{color(AnsiFore.BOLD_WHITE, "wr3")}".')
397
405
  boards_list = rtl87xx_boards.BOARDS.items()
398
406
  elif platform == "RP2040":
399
- safe_print(f'For example "{color(Fore.BOLD_WHITE, "rpipicow")}".')
407
+ safe_print(f'For example "{color(AnsiFore.BOLD_WHITE, "rpipicow")}".')
400
408
  boards_list = rp2040_boards.BOARDS.items()
401
409
 
402
410
  else:
@@ -409,19 +417,21 @@ def wizard(path):
409
417
  boards.append(board_id)
410
418
 
411
419
  while True:
412
- board = safe_input(color(Fore.BOLD_WHITE, "(board): "))
420
+ board = safe_input(color(AnsiFore.BOLD_WHITE, "(board): "))
413
421
  try:
414
422
  board = vol.All(vol.Lower, vol.Any(*boards))(board)
415
423
  break
416
424
  except vol.Invalid:
417
425
  safe_print(
418
- color(Fore.RED, f'Sorry, I don\'t think the board "{board}" exists.')
426
+ color(
427
+ AnsiFore.RED, f'Sorry, I don\'t think the board "{board}" exists.'
428
+ )
419
429
  )
420
430
  safe_print()
421
431
  sleep(0.25)
422
432
  safe_print()
423
433
 
424
- safe_print(f"Way to go! You've chosen {color(Fore.CYAN, board)} as your board.")
434
+ safe_print(f"Way to go! You've chosen {color(AnsiFore.CYAN, board)} as your board.")
425
435
  safe_print()
426
436
  sleep(1)
427
437
 
@@ -432,19 +442,19 @@ def wizard(path):
432
442
  safe_print()
433
443
  sleep(1)
434
444
  safe_print(
435
- f"First, what's the {color(Fore.GREEN, 'SSID')} (the name) of the WiFi network {name} should connect to?"
445
+ f"First, what's the {color(AnsiFore.GREEN, 'SSID')} (the name) of the WiFi network {name} should connect to?"
436
446
  )
437
447
  sleep(1.5)
438
- safe_print(f'For example "{color(Fore.BOLD_WHITE, "Abraham Linksys")}".')
448
+ safe_print(f'For example "{color(AnsiFore.BOLD_WHITE, "Abraham Linksys")}".')
439
449
  while True:
440
- ssid = safe_input(color(Fore.BOLD_WHITE, "(ssid): "))
450
+ ssid = safe_input(color(AnsiFore.BOLD_WHITE, "(ssid): "))
441
451
  try:
442
452
  ssid = cv.ssid(ssid)
443
453
  break
444
454
  except vol.Invalid:
445
455
  safe_print(
446
456
  color(
447
- Fore.RED,
457
+ AnsiFore.RED,
448
458
  f'Unfortunately, "{ssid}" doesn\'t seem to be a valid SSID. Please try again.',
449
459
  )
450
460
  )
@@ -452,18 +462,18 @@ def wizard(path):
452
462
  sleep(1)
453
463
 
454
464
  safe_print(
455
- f'Thank you very much! You\'ve just chosen "{color(Fore.CYAN, ssid)}" as your SSID.'
465
+ f'Thank you very much! You\'ve just chosen "{color(AnsiFore.CYAN, ssid)}" as your SSID.'
456
466
  )
457
467
  safe_print()
458
468
  sleep(0.75)
459
469
 
460
470
  safe_print(
461
- f"Now please state the {color(Fore.GREEN, 'password')} of the WiFi network so that I can connect to it (Leave empty for no password)"
471
+ f"Now please state the {color(AnsiFore.GREEN, 'password')} of the WiFi network so that I can connect to it (Leave empty for no password)"
462
472
  )
463
473
  safe_print()
464
- safe_print(f'For example "{color(Fore.BOLD_WHITE, "PASSWORD42")}"')
474
+ safe_print(f'For example "{color(AnsiFore.BOLD_WHITE, "PASSWORD42")}"')
465
475
  sleep(0.5)
466
- psk = safe_input(color(Fore.BOLD_WHITE, "(PSK): "))
476
+ psk = safe_input(color(AnsiFore.BOLD_WHITE, "(PSK): "))
467
477
  safe_print(
468
478
  "Perfect! WiFi is now set up (you can create static IPs and so on later)."
469
479
  )
@@ -475,12 +485,12 @@ def wizard(path):
475
485
  "(over the air) and integrates into Home Assistant with a native API."
476
486
  )
477
487
  safe_print(
478
- f"This can be insecure if you do not trust the WiFi network. Do you want to set a {color(Fore.GREEN, 'password')} for connecting to this ESP?"
488
+ f"This can be insecure if you do not trust the WiFi network. Do you want to set a {color(AnsiFore.GREEN, 'password')} for connecting to this ESP?"
479
489
  )
480
490
  safe_print()
481
491
  sleep(0.25)
482
492
  safe_print("Press ENTER for no password")
483
- password = safe_input(color(Fore.BOLD_WHITE, "(password): "))
493
+ password = safe_input(color(AnsiFore.BOLD_WHITE, "(password): "))
484
494
  else:
485
495
  ssid, password, psk = "", "", ""
486
496
 
@@ -497,8 +507,8 @@ def wizard(path):
497
507
 
498
508
  safe_print()
499
509
  safe_print(
500
- color(Fore.CYAN, "DONE! I've now written a new configuration file to ")
501
- + color(Fore.BOLD_CYAN, path)
510
+ color(AnsiFore.CYAN, "DONE! I've now written a new configuration file to ")
511
+ + color(AnsiFore.BOLD_CYAN, path)
502
512
  )
503
513
  safe_print()
504
514
  safe_print("Next steps:")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: esphome
3
- Version: 2025.5.0b2
3
+ Version: 2025.5.0b4
4
4
  Summary: ESPHome is a system to configure your microcontrollers by simple yet powerful configuration files and control them remotely through Home Automation systems.
5
5
  Author-email: The ESPHome Authors <esphome@openhomefoundation.org>
6
6
  License: MIT