esphome 2025.2.0b1__py3-none-any.whl → 2025.2.0b2__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,8 +1,5 @@
1
1
  #include "cse7766.h"
2
2
  #include "esphome/core/log.h"
3
- #include <cinttypes>
4
- #include <iomanip>
5
- #include <sstream>
6
3
 
7
4
  namespace esphome {
8
5
  namespace cse7766 {
@@ -72,12 +69,8 @@ bool CSE7766Component::check_byte_() {
72
69
  void CSE7766Component::parse_data_() {
73
70
  #if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERY_VERBOSE
74
71
  {
75
- std::stringstream ss;
76
- ss << "Raw data:" << std::hex << std::uppercase << std::setfill('0');
77
- for (uint8_t i = 0; i < 23; i++) {
78
- ss << ' ' << std::setw(2) << static_cast<unsigned>(this->raw_data_[i]);
79
- }
80
- ESP_LOGVV(TAG, "%s", ss.str().c_str());
72
+ std::string s = format_hex_pretty(this->raw_data_, sizeof(this->raw_data_));
73
+ ESP_LOGVV(TAG, "Raw data: %s", s.c_str());
81
74
  }
82
75
  #endif
83
76
 
@@ -211,21 +204,20 @@ void CSE7766Component::parse_data_() {
211
204
 
212
205
  #if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERY_VERBOSE
213
206
  {
214
- std::stringstream ss;
215
- ss << "Parsed:";
207
+ std::string buf = "Parsed:";
216
208
  if (have_voltage) {
217
- ss << " V=" << voltage << "V";
209
+ buf += str_sprintf(" V=%fV", voltage);
218
210
  }
219
211
  if (have_current) {
220
- ss << " I=" << current * 1000.0f << "mA (~" << calculated_current * 1000.0f << "mA)";
212
+ buf += str_sprintf(" I=%fmA (~%fmA)", current * 1000.0f, calculated_current * 1000.0f);
221
213
  }
222
214
  if (have_power) {
223
- ss << " P=" << power << "W";
215
+ buf += str_sprintf(" P=%fW", power);
224
216
  }
225
217
  if (energy != 0.0f) {
226
- ss << " E=" << energy << "kWh (" << cf_pulses << ")";
218
+ buf += str_sprintf(" E=%fkWh (%u)", energy, cf_pulses);
227
219
  }
228
- ESP_LOGVV(TAG, "%s", ss.str().c_str());
220
+ ESP_LOGVV(TAG, "%s", buf.c_str());
229
221
  }
230
222
  #endif
231
223
  }
@@ -4,9 +4,6 @@
4
4
  #include "esphome/core/log.h"
5
5
  #include "esphome/core/hal.h"
6
6
  #include <algorithm>
7
- #include <sstream>
8
- #include <iostream> // std::cout, std::fixed
9
- #include <iomanip>
10
7
  namespace esphome {
11
8
  namespace graph {
12
9
 
@@ -231,9 +228,8 @@ void GraphLegend::init(Graph *g) {
231
228
  ESP_LOGI(TAGL, " %s %d %d", txtstr.c_str(), fw, fh);
232
229
 
233
230
  if (this->values_ != VALUE_POSITION_TYPE_NONE) {
234
- std::stringstream ss;
235
- ss << std::fixed << std::setprecision(trace->sensor_->get_accuracy_decimals()) << trace->sensor_->get_state();
236
- std::string valstr = ss.str();
231
+ std::string valstr =
232
+ value_accuracy_to_string(trace->sensor_->get_state(), trace->sensor_->get_accuracy_decimals());
237
233
  if (this->units_) {
238
234
  valstr += trace->sensor_->get_unit_of_measurement();
239
235
  }
@@ -368,9 +364,8 @@ void Graph::draw_legend(display::Display *buff, uint16_t x_offset, uint16_t y_of
368
364
  if (legend_->values_ != VALUE_POSITION_TYPE_NONE) {
369
365
  int xv = x + legend_->xv_;
370
366
  int yv = y + legend_->yv_;
371
- std::stringstream ss;
372
- ss << std::fixed << std::setprecision(trace->sensor_->get_accuracy_decimals()) << trace->sensor_->get_state();
373
- std::string valstr = ss.str();
367
+ std::string valstr =
368
+ value_accuracy_to_string(trace->sensor_->get_state(), trace->sensor_->get_accuracy_decimals());
374
369
  if (legend_->units_) {
375
370
  valstr += trace->sensor_->get_unit_of_measurement();
376
371
  }
@@ -1,8 +1,6 @@
1
1
 
2
2
  #include "modbus_textsensor.h"
3
3
  #include "esphome/core/log.h"
4
- #include <iomanip>
5
- #include <sstream>
6
4
 
7
5
  namespace esphome {
8
6
  namespace modbus_controller {
@@ -12,20 +10,17 @@ static const char *const TAG = "modbus_controller.text_sensor";
12
10
  void ModbusTextSensor::dump_config() { LOG_TEXT_SENSOR("", "Modbus Controller Text Sensor", this); }
13
11
 
14
12
  void ModbusTextSensor::parse_and_publish(const std::vector<uint8_t> &data) {
15
- std::ostringstream output;
13
+ std::string output_str{};
16
14
  uint8_t items_left = this->response_bytes;
17
15
  uint8_t index = this->offset;
18
- char buffer[5];
19
16
  while ((items_left > 0) && index < data.size()) {
20
17
  uint8_t b = data[index];
21
18
  switch (this->encode_) {
22
19
  case RawEncoding::HEXBYTES:
23
- sprintf(buffer, "%02x", b);
24
- output << buffer;
20
+ output_str += str_snprintf("%02x", 2, b);
25
21
  break;
26
22
  case RawEncoding::COMMA:
27
- sprintf(buffer, index != this->offset ? ",%d" : "%d", b);
28
- output << buffer;
23
+ output_str += str_sprintf(index != this->offset ? ",%d" : "%d", b);
29
24
  break;
30
25
  case RawEncoding::ANSI:
31
26
  if (b < 0x20)
@@ -33,25 +28,24 @@ void ModbusTextSensor::parse_and_publish(const std::vector<uint8_t> &data) {
33
28
  // FALLTHROUGH
34
29
  // Anything else no encoding
35
30
  default:
36
- output << (char) b;
31
+ output_str += (char) b;
37
32
  break;
38
33
  }
39
34
  items_left--;
40
35
  index++;
41
36
  }
42
37
 
43
- auto result = output.str();
44
38
  // Is there a lambda registered
45
39
  // call it with the pre converted value and the raw data array
46
40
  if (this->transform_func_.has_value()) {
47
41
  // the lambda can parse the response itself
48
- auto val = (*this->transform_func_)(this, result, data);
42
+ auto val = (*this->transform_func_)(this, output_str, data);
49
43
  if (val.has_value()) {
50
44
  ESP_LOGV(TAG, "Value overwritten by lambda");
51
- result = val.value();
45
+ output_str = val.value();
52
46
  }
53
47
  }
54
- this->publish_state(result);
48
+ this->publish_state(output_str);
55
49
  }
56
50
 
57
51
  } // namespace modbus_controller
esphome/const.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """Constants used by esphome."""
2
2
 
3
- __version__ = "2025.2.0b1"
3
+ __version__ = "2025.2.0b2"
4
4
 
5
5
  ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
6
6
  VALID_SUBSTITUTIONS_CHARACTERS = (
esphome/core/__init__.py CHANGED
@@ -582,7 +582,7 @@ class EsphomeCore:
582
582
 
583
583
  @property
584
584
  def config_dir(self):
585
- return os.path.dirname(os.path.abspath(self.config_path))
585
+ return os.path.abspath(os.path.dirname(self.config_path))
586
586
 
587
587
  @property
588
588
  def data_dir(self):
esphome/core/config.py CHANGED
@@ -217,6 +217,8 @@ def preload_core_config(config, result) -> str:
217
217
  target_platforms = []
218
218
 
219
219
  for domain, _ in config.items():
220
+ if domain.startswith("."):
221
+ continue
220
222
  if _is_target_platform(domain):
221
223
  target_platforms += [domain]
222
224
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: esphome
3
- Version: 2025.2.0b1
3
+ Version: 2025.2.0b2
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@nabucasa.com>
6
6
  License: MIT
@@ -38,7 +38,7 @@ Requires-Dist: esptool ==4.7.0
38
38
  Requires-Dist: click ==8.1.7
39
39
  Requires-Dist: esphome-dashboard ==20250212.0
40
40
  Requires-Dist: aioesphomeapi ==24.6.2
41
- Requires-Dist: zeroconf ==0.143.0
41
+ Requires-Dist: zeroconf ==0.144.1
42
42
  Requires-Dist: puremagic ==1.27
43
43
  Requires-Dist: ruamel.yaml ==0.18.6
44
44
  Requires-Dist: glyphsets ==1.0.0
@@ -5,7 +5,7 @@ esphome/codegen.py,sha256=GePHUM7xdXb_Pil59SHVsXg2F4VBPgkH-Fz2PDX8Z54,1873
5
5
  esphome/config.py,sha256=fFrDYbhWY1xn_onAl_0jwlg9D8NkK_FdKULTlnjZtxs,39832
6
6
  esphome/config_helpers.py,sha256=MKf_wzO35nn41FvigXE0iYKDslPgL2ruf8R-EPtTT2I,3256
7
7
  esphome/config_validation.py,sha256=qpNSoruGC4Tb7KNtgahginfMrhoRdjYUs-3Et2ww7rg,67868
8
- esphome/const.py,sha256=fTq_s7aTaHT0tMPhnOub9lQCcma0yv12p1865-y5awE,40664
8
+ esphome/const.py,sha256=1lXArnKqFSKaGdxgtevHrwuyjUeIY8FbSlD8nSXPvcs,40664
9
9
  esphome/coroutine.py,sha256=j_14z8dIIzIBeuNO30D4c1RJvMMt1xZFZ58Evd-EvJA,9344
10
10
  esphome/cpp_generator.py,sha256=PS_vtNLykRldK7n2bSZ1e9zIEajnCNc_ruW9beMNulQ,31235
11
11
  esphome/cpp_helpers.py,sha256=6C2vNbOIhZKi43xRVlk5hp9GfshfBn-rc5D_ZFUEYaE,4801
@@ -559,7 +559,7 @@ esphome/components/cse7761/cse7761.cpp,sha256=tsZJZYSmexAqgpxgRgFPDE9x20TmPIWslW
559
559
  esphome/components/cse7761/cse7761.h,sha256=GYUBIQqtqnCre8hcwRhLFH9jlbWVvPcaCvtOOdTZfmc,1805
560
560
  esphome/components/cse7761/sensor.py,sha256=4_1oWJ_Tg0yfgTpWIvYknppGEN9sdo3PfzVEJNAMhGA,2838
561
561
  esphome/components/cse7766/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
562
- esphome/components/cse7766/cse7766.cpp,sha256=qJ63AmIxCSrnGTc3FDvm3BBBdzQNXWZiUvWw1_vdgAk,7837
562
+ esphome/components/cse7766/cse7766.cpp,sha256=cRJmbhQbJOixRQDr09pgs5mYL0SukqkNHjtdw2xoi3A,7640
563
563
  esphome/components/cse7766/cse7766.h,sha256=RE_q5Sa2n8PLkQsO3C9Nt11g6PS_5XBIVD1w3yvzP5o,1743
564
564
  esphome/components/cse7766/sensor.py,sha256=rHZGEUgTD8j6V9u8kTKSfRWQ67HzqIeHa9YaC5j6K70,4082
565
565
  esphome/components/cst226/__init__.py,sha256=Xbt13-GS0lUNexCt3EYip3UvO15P2cdJdepZWoDqBw8,130
@@ -1011,7 +1011,7 @@ esphome/components/gps/time/__init__.py,sha256=iuZWg8qhi8uMoah4B2z4OyAsXndE9z6oH
1011
1011
  esphome/components/gps/time/gps_time.cpp,sha256=XEslYAhMq8ZViWF0QfoO95JiISUj0TLeuRcU4CnJq_8,958
1012
1012
  esphome/components/gps/time/gps_time.h,sha256=LTbCT36s68Sjifw0Qv6yxo5aiv2NK6Zreh1Rmtkxsqk,624
1013
1013
  esphome/components/graph/__init__.py,sha256=cxfJJTEGoaQ_3EAo5_cWUvLWAUjeoNyI4mqoxwkm_cc,7819
1014
- esphome/components/graph/graph.cpp,sha256=pNnuAOKvfNIkPskUBbux8Sp6Mt-iW7G6cFr0tK2G7-o,12423
1014
+ esphome/components/graph/graph.cpp,sha256=1pwQFl5M0L4eJJhlL5x1uAsVNBOHnTXvvKd695WHhos,12241
1015
1015
  esphome/components/graph/graph.h,sha256=hEOwQKaakerdidM9Gw6gibKu0zmdZZ1MCa1qXGga6xo,6021
1016
1016
  esphome/components/graphical_display_menu/__init__.py,sha256=YGbv_JsuWmW3HumvMZq0EwJszFmaXGbNYrrl9OPhNEc,3557
1017
1017
  esphome/components/graphical_display_menu/graphical_display_menu.cpp,sha256=_1xbdf6a_krZS-xD8D4kRW32QPz68zWs-MrXLOYYThU,9146
@@ -1786,7 +1786,7 @@ esphome/components/modbus_controller/switch/__init__.py,sha256=0-EmJSlIhN19Ur3Kf
1786
1786
  esphome/components/modbus_controller/switch/modbus_switch.cpp,sha256=Ywebesg2KPfprVx3xhJUCq27nYUnbusds5n0Z8uigK0,4257
1787
1787
  esphome/components/modbus_controller/switch/modbus_switch.h,sha256=uZsGSRtxKnAWqUZ8k_qITEkDnK_BNjaYB_CV7TmhqVQ,2042
1788
1788
  esphome/components/modbus_controller/text_sensor/__init__.py,sha256=9STUDiChfJ9LPrcQaHDGN3qtD1S9R9CvyKa_VM2kkyo,2451
1789
- esphome/components/modbus_controller/text_sensor/modbus_textsensor.cpp,sha256=iebbTljSNJBPUTKfbbHemYxgswLZM_RyjRERQqIFKTM,1594
1789
+ esphome/components/modbus_controller/text_sensor/modbus_textsensor.cpp,sha256=AcFEMUSArTKtXE4ITDaEyRzDlEKnAz4RH_LU36vDUtk,1495
1790
1790
  esphome/components/modbus_controller/text_sensor/modbus_textsensor.h,sha256=dbvPjN9sfXOPllbLbyyrHLhqyp_9aiJBVg4kki8Zst8,1508
1791
1791
  esphome/components/monochromatic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1792
1792
  esphome/components/monochromatic/light.py,sha256=THKgebL_J4kCyt42O5y0kBbMZP1f885MO7fEbycvxnA,761
@@ -3376,7 +3376,7 @@ esphome/components/zyaura/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
3376
3376
  esphome/components/zyaura/sensor.py,sha256=_h1Idxd8vvYR3le4a92yh8dlbl4NOtzxss-HuAUTcdI,2476
3377
3377
  esphome/components/zyaura/zyaura.cpp,sha256=F7WM8XAZ5MYuCD3eERm2_IA-O7sP1i-A-yF5TV4PqX8,3679
3378
3378
  esphome/components/zyaura/zyaura.h,sha256=yWrcYj_CnLDyopkuIVySJy5dB-R5X9zwm5fWjBDTSts,2384
3379
- esphome/core/__init__.py,sha256=QDLtTI3XnqPxCumWbfoPOHU6cuhWCgct9l03FLjAaxk,26760
3379
+ esphome/core/__init__.py,sha256=L4pbrSzT5rq3ba3Xm1N5xiRx4m5a4pKN5wBwvUwWZLU,26760
3380
3380
  esphome/core/application.cpp,sha256=DOhq0rTYu_dNcUCavHYVYASQZ5QzVOXMWVTaO7YTdnM,4680
3381
3381
  esphome/core/application.h,sha256=jepd6I9BBa48ByAXoLnUE7ddtlHiUS5uuKaMaJOD0x0,17721
3382
3382
  esphome/core/automation.h,sha256=UQQD9De3eiaopvzYQG89SxkBfnL5QaiR6bvkk2RxV8k,7332
@@ -3387,7 +3387,7 @@ esphome/core/component.cpp,sha256=36VvNdGwaqJZFPmGP3pQydSo4XIhjYwhsBcq3N2Jorg,93
3387
3387
  esphome/core/component.h,sha256=U4m8_g9gSBBIjRNw4k36entP2JcA6F3SsWbwty_hKdo,11744
3388
3388
  esphome/core/component_iterator.cpp,sha256=TUu2K34ATYa1Qyf2s-sZJBksAiFIGj3egzbDKPuFtTQ,11117
3389
3389
  esphome/core/component_iterator.h,sha256=cjacKgRrlxl-VwPOysfBJZNK0NMzcc-w9xXn82m5dYc,3599
3390
- esphome/core/config.py,sha256=0iLMMZ2b1N34cAr33CnDMbbiWgtnNoelHgE4Hs7NFmc,13617
3390
+ esphome/core/config.py,sha256=mwc-PFAE0wNKxgYZzt-2B08M4JQZ5KBYRtfuRCHvlPM,13673
3391
3391
  esphome/core/controller.cpp,sha256=feO4yH0GETNCqi9MTZEtsOaoo-CPV2rM9S7UfQXY6Ew,4553
3392
3392
  esphome/core/controller.h,sha256=PXCcMqYpq0xjFCdlOKv6WuYlcETnB4sq3UQWdOTt9PU,3720
3393
3393
  esphome/core/datatypes.h,sha256=wN8xro8vqXT13w9KvVOXeQfBwlI_WQZ6uFaIGyub67E,2114
@@ -3434,9 +3434,9 @@ esphome/dashboard/util/itertools.py,sha256=8eLrWEWmICLtXNxkKdYPQV0c_N4GEz8m9Npnb
3434
3434
  esphome/dashboard/util/password.py,sha256=cQz3b9B-ijTe7zS6BeCW0hc3pWv6JjC78jmnycYYAh8,321
3435
3435
  esphome/dashboard/util/subprocess.py,sha256=T8EW6dbU4LPd2DG1dRrdh8li71tt6J1isn411poMhkk,1022
3436
3436
  esphome/dashboard/util/text.py,sha256=ENDnfN4O0NdA3CKVJjQYabFbwbrsIhVKrAMQe53qYu4,534
3437
- esphome-2025.2.0b1.dist-info/LICENSE,sha256=HzEjkBInJe44L4WvAOPfhPJJDNj6YbnqFyvGWRzArGM,36664
3438
- esphome-2025.2.0b1.dist-info/METADATA,sha256=spWvVp5o6IN1zHWX8FphVA5YqJ3iF_yLFTlRDsfUifI,3683
3439
- esphome-2025.2.0b1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
3440
- esphome-2025.2.0b1.dist-info/entry_points.txt,sha256=mIxVNuWtbYzeEcaWCl-AQ-97aBOWbnYBAK8nbF6P4M0,50
3441
- esphome-2025.2.0b1.dist-info/top_level.txt,sha256=0GSXEW3cnITpgG3qnsSMz0qoqJHAFyfw7Y8MVtEf1Yk,8
3442
- esphome-2025.2.0b1.dist-info/RECORD,,
3437
+ esphome-2025.2.0b2.dist-info/LICENSE,sha256=HzEjkBInJe44L4WvAOPfhPJJDNj6YbnqFyvGWRzArGM,36664
3438
+ esphome-2025.2.0b2.dist-info/METADATA,sha256=Z1Su6fIDf73B7X47khzxxAj0TMw-fjlqQkmOgwrs4P4,3683
3439
+ esphome-2025.2.0b2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
3440
+ esphome-2025.2.0b2.dist-info/entry_points.txt,sha256=mIxVNuWtbYzeEcaWCl-AQ-97aBOWbnYBAK8nbF6P4M0,50
3441
+ esphome-2025.2.0b2.dist-info/top_level.txt,sha256=0GSXEW3cnITpgG3qnsSMz0qoqJHAFyfw7Y8MVtEf1Yk,8
3442
+ esphome-2025.2.0b2.dist-info/RECORD,,