esphome 2024.6.3__py3-none-any.whl → 2024.6.4__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.
@@ -1,7 +1,10 @@
1
+ import logging
2
+
1
3
  import esphome.codegen as cg
2
4
  import esphome.config_validation as cv
3
5
  import esphome.final_validate as fv
4
6
  from esphome.components.ota import BASE_OTA_SCHEMA, ota_to_code, OTAComponent
7
+ from esphome.config_helpers import merge_config
5
8
  from esphome.const import (
6
9
  CONF_ESPHOME,
7
10
  CONF_ID,
@@ -16,6 +19,8 @@ from esphome.const import (
16
19
  )
17
20
  from esphome.core import coroutine_with_priority
18
21
 
22
+ _LOGGER = logging.getLogger(__name__)
23
+
19
24
 
20
25
  CODEOWNERS = ["@esphome/core"]
21
26
  AUTO_LOAD = ["md5", "socket"]
@@ -26,16 +31,62 @@ ESPHomeOTAComponent = esphome.class_("ESPHomeOTAComponent", OTAComponent)
26
31
 
27
32
 
28
33
  def ota_esphome_final_validate(config):
29
- fconf = fv.full_config.get()[CONF_OTA]
30
- used_ports = []
31
- for ota_conf in fconf:
34
+ full_conf = fv.full_config.get()
35
+ full_ota_conf = full_conf[CONF_OTA]
36
+ new_ota_conf = []
37
+ merged_ota_esphome_configs_by_port = {}
38
+ ports_with_merged_configs = []
39
+ for ota_conf in full_ota_conf:
32
40
  if ota_conf.get(CONF_PLATFORM) == CONF_ESPHOME:
33
- if (plat_port := ota_conf.get(CONF_PORT)) not in used_ports:
34
- used_ports.append(plat_port)
41
+ if (
42
+ conf_port := ota_conf.get(CONF_PORT)
43
+ ) not in merged_ota_esphome_configs_by_port:
44
+ merged_ota_esphome_configs_by_port[conf_port] = ota_conf
35
45
  else:
36
- raise cv.Invalid(
37
- f"Only one instance of the {CONF_ESPHOME} {CONF_OTA} {CONF_PLATFORM} is allowed per port. Note that this error may result from OTA specified in packages"
46
+ if merged_ota_esphome_configs_by_port[conf_port][
47
+ CONF_VERSION
48
+ ] != ota_conf.get(CONF_VERSION):
49
+ raise cv.Invalid(
50
+ f"Found multiple configurations but {CONF_VERSION} is inconsistent"
51
+ )
52
+ if (
53
+ merged_ota_esphome_configs_by_port[conf_port][CONF_ID].is_manual
54
+ and ota_conf.get(CONF_ID).is_manual
55
+ ):
56
+ raise cv.Invalid(
57
+ f"Found multiple configurations but {CONF_ID} is inconsistent"
58
+ )
59
+ if (
60
+ CONF_PASSWORD in merged_ota_esphome_configs_by_port[conf_port]
61
+ and CONF_PASSWORD in ota_conf
62
+ and merged_ota_esphome_configs_by_port[conf_port][CONF_PASSWORD]
63
+ != ota_conf.get(CONF_PASSWORD)
64
+ ):
65
+ raise cv.Invalid(
66
+ f"Found multiple configurations but {CONF_PASSWORD} is inconsistent"
67
+ )
68
+
69
+ ports_with_merged_configs.append(conf_port)
70
+ merged_ota_esphome_configs_by_port[conf_port] = merge_config(
71
+ merged_ota_esphome_configs_by_port[conf_port], ota_conf
38
72
  )
73
+ else:
74
+ new_ota_conf.append(ota_conf)
75
+
76
+ for port_conf in merged_ota_esphome_configs_by_port.values():
77
+ new_ota_conf.append(port_conf)
78
+
79
+ full_conf[CONF_OTA] = new_ota_conf
80
+ fv.full_config.set(full_conf)
81
+
82
+ if len(ports_with_merged_configs) > 0:
83
+ _LOGGER.warning(
84
+ "Found and merged multiple configurations for %s %s %s port(s) %s",
85
+ CONF_OTA,
86
+ CONF_PLATFORM,
87
+ CONF_ESPHOME,
88
+ ports_with_merged_configs,
89
+ )
39
90
 
40
91
 
41
92
  CONFIG_SCHEMA = (
@@ -115,12 +115,15 @@ void LEDCOutput::write_state(float state) {
115
115
  const uint32_t max_duty = (uint32_t(1) << this->bit_depth_) - 1;
116
116
  const float duty_rounded = roundf(state * max_duty);
117
117
  auto duty = static_cast<uint32_t>(duty_rounded);
118
-
119
118
  #ifdef USE_ARDUINO
120
119
  ESP_LOGV(TAG, "Setting duty: %u on channel %u", duty, this->channel_);
121
120
  ledcWrite(this->channel_, duty);
122
121
  #endif
123
122
  #ifdef USE_ESP_IDF
123
+ // ensure that 100% on is not 99.975% on
124
+ if ((duty == max_duty) && (max_duty != 1)) {
125
+ duty = max_duty + 1;
126
+ }
124
127
  auto speed_mode = get_speed_mode(channel_);
125
128
  auto chan_num = static_cast<ledc_channel_t>(channel_ % 8);
126
129
  int hpoint = ledc_angle_to_htop(this->phase_angle_, this->bit_depth_);
esphome/const.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """Constants used by esphome."""
2
2
 
3
- __version__ = "2024.6.3"
3
+ __version__ = "2024.6.4"
4
4
 
5
5
  ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
6
6
  VALID_SUBSTITUTIONS_CHARACTERS = (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: esphome
3
- Version: 2024.6.3
3
+ Version: 2024.6.4
4
4
  Summary: Make creating custom firmwares for ESP32/ESP8266 super easy.
5
5
  Author-email: The ESPHome Authors <esphome@nabucasa.com>
6
6
  License: MIT
@@ -5,7 +5,7 @@ esphome/codegen.py,sha256=LCJVpAwy1L9DTBsIvbgAbHj1TOXUSPgBoN--aio0gBk,1855
5
5
  esphome/config.py,sha256=wztK2UmO7-hc6HFDAi6YWtrPVy5mH0diKuqpsWp4-XA,39616
6
6
  esphome/config_helpers.py,sha256=MKf_wzO35nn41FvigXE0iYKDslPgL2ruf8R-EPtTT2I,3256
7
7
  esphome/config_validation.py,sha256=G79LGVIh5BdpGkzuehkm7Db_llpbC2of4dKqZEpHc3A,64838
8
- esphome/const.py,sha256=xBNzlCHOc7TMF2WgpADpQbGL4C-nEc93fw_8J0tdr2A,38841
8
+ esphome/const.py,sha256=rOpMLPHKDSJGYe933DKChKQZ8ujBjrdX5MenEbIzDDM,38841
9
9
  esphome/coroutine.py,sha256=IG2kC92OrenyiRm7Qo9uC-4qU4b4-Lmj0TkMIjRG2RY,9344
10
10
  esphome/cpp_generator.py,sha256=hW2EfubUiildhKXZIdV8Dr3Q9TM5oHybFwiTo5-vEUE,31203
11
11
  esphome/cpp_helpers.py,sha256=KadRBBoo4QRT-VwdWFtvxv_FYjqhZTkBhfMX-JhEMwg,4803
@@ -813,7 +813,7 @@ esphome/components/esp8266_pwm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
813
813
  esphome/components/esp8266_pwm/esp8266_pwm.cpp,sha256=c4_NPBOfBdguJghAdx7d9cwtyJscVEhWD4_Xkavbmfw,1703
814
814
  esphome/components/esp8266_pwm/esp8266_pwm.h,sha256=YLObIixl3YFDx3biu1TVfH6qyOFFts-VGT4pxgN0PHw,1386
815
815
  esphome/components/esp8266_pwm/output.py,sha256=7qgJT-O8nr0HjFajwbw2k_DlXwG_SLfP4ma82-GF-ew,2062
816
- esphome/components/esphome/ota/__init__.py,sha256=1m6H-VfFmFX1Y3lbDDQNwsn4SEDVjhI8D3IfMtC5jz4,2937
816
+ esphome/components/esphome/ota/__init__.py,sha256=9QLHdgokrTMdyiLj6o7skLjyNpJ7riR6e1IWCa0eirc,4851
817
817
  esphome/components/esphome/ota/ota_esphome.cpp,sha256=k2mo3SWZvQXLCZIeEIb_d6IV8D5vD5ynnlcjq_zPyCM,12334
818
818
  esphome/components/esphome/ota/ota_esphome.h,sha256=8j_EDYbc7UiALElGt6NN834RDfCxD8oLHkJbhyaXtV4,1118
819
819
  esphome/components/ethernet/__init__.py,sha256=5mP3op-0A0eSGc8NyrmzEEPaDgt4pBj2NKFubj7E7tw,8821
@@ -1284,7 +1284,7 @@ esphome/components/ld2420/text_sensor/__init__.py,sha256=XqAcpd7R_yDQt97TkQTWTQh
1284
1284
  esphome/components/ld2420/text_sensor/text_sensor.cpp,sha256=T8Hlo3rGbyEpKMlFHTfjMMZIueh_Xac5GfAWnOZ-IMk,385
1285
1285
  esphome/components/ld2420/text_sensor/text_sensor.h,sha256=aK91ri0NvHth3ya0zN1OeX81v1nqveoiJcOfqCpaAJI,672
1286
1286
  esphome/components/ledc/__init__.py,sha256=PTP_5q_K_2dNnUdkolkVd5komlEbJdS4lolCp8dvjKk,29
1287
- esphome/components/ledc/ledc_output.cpp,sha256=C9knx1rJwM5wAR7IN5eNlBLVWjXTfMQRqq7XUgXlDC4,9655
1287
+ esphome/components/ledc/ledc_output.cpp,sha256=ypYkN4xnBCzSkZR-jZCCNO04zloO_O2O5wpo58vzAG4,9773
1288
1288
  esphome/components/ledc/ledc_output.h,sha256=hok37ypQ7BjJkJc22_z8p9qwkH4K1e_xRASNgMBZFyE,1663
1289
1289
  esphome/components/ledc/output.py,sha256=8pYjboSYH2GmMpmwM6sT7ryV81rSM4FuGGloZcqXFR0,2725
1290
1290
  esphome/components/libretiny/__init__.py,sha256=Ad0Vp-_5g1NDlRh2c1U_iZwAzwqGvR9cSDNgiMbO4c4,11555
@@ -3113,9 +3113,9 @@ esphome/dashboard/util/itertools.py,sha256=8eLrWEWmICLtXNxkKdYPQV0c_N4GEz8m9Npnb
3113
3113
  esphome/dashboard/util/password.py,sha256=cQz3b9B-ijTe7zS6BeCW0hc3pWv6JjC78jmnycYYAh8,321
3114
3114
  esphome/dashboard/util/subprocess.py,sha256=T8EW6dbU4LPd2DG1dRrdh8li71tt6J1isn411poMhkk,1022
3115
3115
  esphome/dashboard/util/text.py,sha256=ENDnfN4O0NdA3CKVJjQYabFbwbrsIhVKrAMQe53qYu4,534
3116
- esphome-2024.6.3.dist-info/LICENSE,sha256=HzEjkBInJe44L4WvAOPfhPJJDNj6YbnqFyvGWRzArGM,36664
3117
- esphome-2024.6.3.dist-info/METADATA,sha256=XxGlE7TMgBTmVRtBdXeX1mk18OohHoKKDrVxSbduukM,3263
3118
- esphome-2024.6.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
3119
- esphome-2024.6.3.dist-info/entry_points.txt,sha256=mIxVNuWtbYzeEcaWCl-AQ-97aBOWbnYBAK8nbF6P4M0,50
3120
- esphome-2024.6.3.dist-info/top_level.txt,sha256=0GSXEW3cnITpgG3qnsSMz0qoqJHAFyfw7Y8MVtEf1Yk,8
3121
- esphome-2024.6.3.dist-info/RECORD,,
3116
+ esphome-2024.6.4.dist-info/LICENSE,sha256=HzEjkBInJe44L4WvAOPfhPJJDNj6YbnqFyvGWRzArGM,36664
3117
+ esphome-2024.6.4.dist-info/METADATA,sha256=WEmYmMCEMIYOVRuadySo5HTVBv6o50md1IXyZRgj3yQ,3263
3118
+ esphome-2024.6.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
3119
+ esphome-2024.6.4.dist-info/entry_points.txt,sha256=mIxVNuWtbYzeEcaWCl-AQ-97aBOWbnYBAK8nbF6P4M0,50
3120
+ esphome-2024.6.4.dist-info/top_level.txt,sha256=0GSXEW3cnITpgG3qnsSMz0qoqJHAFyfw7Y8MVtEf1Yk,8
3121
+ esphome-2024.6.4.dist-info/RECORD,,