mirror of
https://github.com/esphome/esphome.git
synced 2024-11-27 09:18:00 +01:00
commit
321155eb40
5 changed files with 599 additions and 605 deletions
|
@ -12,6 +12,7 @@ from esphome.const import (
|
||||||
CONF_TRIGGER_ID,
|
CONF_TRIGGER_ID,
|
||||||
CONF_MQTT_ID,
|
CONF_MQTT_ID,
|
||||||
DEVICE_CLASS_EMPTY,
|
DEVICE_CLASS_EMPTY,
|
||||||
|
DEVICE_CLASS_IDENTIFY,
|
||||||
DEVICE_CLASS_RESTART,
|
DEVICE_CLASS_RESTART,
|
||||||
DEVICE_CLASS_UPDATE,
|
DEVICE_CLASS_UPDATE,
|
||||||
)
|
)
|
||||||
|
@ -24,6 +25,7 @@ IS_PLATFORM_COMPONENT = True
|
||||||
|
|
||||||
DEVICE_CLASSES = [
|
DEVICE_CLASSES = [
|
||||||
DEVICE_CLASS_EMPTY,
|
DEVICE_CLASS_EMPTY,
|
||||||
|
DEVICE_CLASS_IDENTIFY,
|
||||||
DEVICE_CLASS_RESTART,
|
DEVICE_CLASS_RESTART,
|
||||||
DEVICE_CLASS_UPDATE,
|
DEVICE_CLASS_UPDATE,
|
||||||
]
|
]
|
||||||
|
|
|
@ -55,3 +55,4 @@ async def to_code(config):
|
||||||
|
|
||||||
if CORE.using_esp_idf:
|
if CORE.using_esp_idf:
|
||||||
add_idf_sdkconfig_option("CONFIG_BT_ENABLED", True)
|
add_idf_sdkconfig_option("CONFIG_BT_ENABLED", True)
|
||||||
|
add_idf_sdkconfig_option("CONFIG_BT_BLE_42_FEATURES_SUPPORTED", True)
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
||||||
"""Constants used by esphome."""
|
"""Constants used by esphome."""
|
||||||
|
|
||||||
__version__ = "2023.6.2"
|
__version__ = "2023.6.3"
|
||||||
|
|
||||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||||
VALID_SUBSTITUTIONS_CHARACTERS = (
|
VALID_SUBSTITUTIONS_CHARACTERS = (
|
||||||
|
@ -968,6 +968,7 @@ DEVICE_CLASS_GAS = "gas"
|
||||||
DEVICE_CLASS_GATE = "gate"
|
DEVICE_CLASS_GATE = "gate"
|
||||||
DEVICE_CLASS_HEAT = "heat"
|
DEVICE_CLASS_HEAT = "heat"
|
||||||
DEVICE_CLASS_HUMIDITY = "humidity"
|
DEVICE_CLASS_HUMIDITY = "humidity"
|
||||||
|
DEVICE_CLASS_IDENTIFY = "identify"
|
||||||
DEVICE_CLASS_ILLUMINANCE = "illuminance"
|
DEVICE_CLASS_ILLUMINANCE = "illuminance"
|
||||||
DEVICE_CLASS_IRRADIANCE = "irradiance"
|
DEVICE_CLASS_IRRADIANCE = "irradiance"
|
||||||
DEVICE_CLASS_LIGHT = "light"
|
DEVICE_CLASS_LIGHT = "light"
|
||||||
|
|
|
@ -546,22 +546,11 @@ class DownloadBinaryRequestHandler(BaseHandler):
|
||||||
return
|
return
|
||||||
|
|
||||||
with open(path, "rb") as f:
|
with open(path, "rb") as f:
|
||||||
while True:
|
data = f.read()
|
||||||
# For a 528KB image used as benchmark:
|
|
||||||
# - using 256KB blocks resulted in the smallest file size.
|
|
||||||
# - blocks larger than 256KB didn't improve the size of compressed file.
|
|
||||||
# - blocks smaller than 256KB hindered compression, making the output file larger.
|
|
||||||
|
|
||||||
# Read file in blocks of 256KB.
|
|
||||||
data = f.read(256 * 1024)
|
|
||||||
|
|
||||||
if not data:
|
|
||||||
break
|
|
||||||
|
|
||||||
if compressed:
|
if compressed:
|
||||||
data = gzip.compress(data, 9)
|
data = gzip.compress(data, 9)
|
||||||
|
|
||||||
self.write(data)
|
self.write(data)
|
||||||
|
|
||||||
self.finish()
|
self.finish()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue