mirror of
https://github.com/esphome/esphome.git
synced 2025-02-07 13:40:59 +00:00
commit
5cb1d18574
@ -186,7 +186,7 @@ async def datetime_date_set_to_code(config, action_id, template_arg, args):
|
|||||||
|
|
||||||
date_config = config[CONF_DATE]
|
date_config = config[CONF_DATE]
|
||||||
if cg.is_template(date_config):
|
if cg.is_template(date_config):
|
||||||
template_ = await cg.templatable(date_config, [], cg.ESPTime)
|
template_ = await cg.templatable(date_config, args, cg.ESPTime)
|
||||||
cg.add(action_var.set_date(template_))
|
cg.add(action_var.set_date(template_))
|
||||||
else:
|
else:
|
||||||
date_struct = cg.StructInitializer(
|
date_struct = cg.StructInitializer(
|
||||||
@ -217,7 +217,7 @@ async def datetime_time_set_to_code(config, action_id, template_arg, args):
|
|||||||
|
|
||||||
time_config = config[CONF_TIME]
|
time_config = config[CONF_TIME]
|
||||||
if cg.is_template(time_config):
|
if cg.is_template(time_config):
|
||||||
template_ = await cg.templatable(time_config, [], cg.ESPTime)
|
template_ = await cg.templatable(time_config, args, cg.ESPTime)
|
||||||
cg.add(action_var.set_time(template_))
|
cg.add(action_var.set_time(template_))
|
||||||
else:
|
else:
|
||||||
time_struct = cg.StructInitializer(
|
time_struct = cg.StructInitializer(
|
||||||
@ -248,7 +248,7 @@ async def datetime_datetime_set_to_code(config, action_id, template_arg, args):
|
|||||||
|
|
||||||
datetime_config = config[CONF_DATETIME]
|
datetime_config = config[CONF_DATETIME]
|
||||||
if cg.is_template(datetime_config):
|
if cg.is_template(datetime_config):
|
||||||
template_ = await cg.templatable(datetime_config, [], cg.ESPTime)
|
template_ = await cg.templatable(datetime_config, args, cg.ESPTime)
|
||||||
cg.add(action_var.set_datetime(template_))
|
cg.add(action_var.set_datetime(template_))
|
||||||
else:
|
else:
|
||||||
datetime_struct = cg.StructInitializer(
|
datetime_struct = cg.StructInitializer(
|
||||||
|
@ -472,13 +472,13 @@ void EthernetComponent::start_connect_() {
|
|||||||
if (err != ESP_ERR_ESP_NETIF_DHCP_ALREADY_STARTED) {
|
if (err != ESP_ERR_ESP_NETIF_DHCP_ALREADY_STARTED) {
|
||||||
ESPHL_ERROR_CHECK(err, "DHCPC start error");
|
ESPHL_ERROR_CHECK(err, "DHCPC start error");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#if USE_NETWORK_IPV6
|
#if USE_NETWORK_IPV6
|
||||||
err = esp_netif_create_ip6_linklocal(this->eth_netif_);
|
err = esp_netif_create_ip6_linklocal(this->eth_netif_);
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
ESPHL_ERROR_CHECK(err, "Enable IPv6 link local failed");
|
ESPHL_ERROR_CHECK(err, "Enable IPv6 link local failed");
|
||||||
}
|
}
|
||||||
#endif /* USE_NETWORK_IPV6 */
|
#endif /* USE_NETWORK_IPV6 */
|
||||||
}
|
|
||||||
|
|
||||||
this->connect_begin_ = millis();
|
this->connect_begin_ = millis();
|
||||||
this->status_set_warning();
|
this->status_set_warning();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
"""Constants used by esphome."""
|
"""Constants used by esphome."""
|
||||||
|
|
||||||
__version__ = "2024.8.1"
|
__version__ = "2024.8.2"
|
||||||
|
|
||||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||||
VALID_SUBSTITUTIONS_CHARACTERS = (
|
VALID_SUBSTITUTIONS_CHARACTERS = (
|
||||||
|
@ -48,6 +48,8 @@ class StorageJSON:
|
|||||||
firmware_bin_path: str,
|
firmware_bin_path: str,
|
||||||
loaded_integrations: set[str],
|
loaded_integrations: set[str],
|
||||||
no_mdns: bool,
|
no_mdns: bool,
|
||||||
|
framework: str | None = None,
|
||||||
|
core_platform: str | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
# Version of the storage JSON schema
|
# Version of the storage JSON schema
|
||||||
assert storage_version is None or isinstance(storage_version, int)
|
assert storage_version is None or isinstance(storage_version, int)
|
||||||
@ -78,6 +80,10 @@ class StorageJSON:
|
|||||||
self.loaded_integrations = loaded_integrations
|
self.loaded_integrations = loaded_integrations
|
||||||
# Is mDNS disabled
|
# Is mDNS disabled
|
||||||
self.no_mdns = no_mdns
|
self.no_mdns = no_mdns
|
||||||
|
# The framework used to compile the firmware
|
||||||
|
self.framework = framework
|
||||||
|
# The core platform of this firmware. Like "esp32", "rp2040", "host" etc.
|
||||||
|
self.core_platform = core_platform
|
||||||
|
|
||||||
def as_dict(self):
|
def as_dict(self):
|
||||||
return {
|
return {
|
||||||
@ -94,6 +100,8 @@ class StorageJSON:
|
|||||||
"firmware_bin_path": self.firmware_bin_path,
|
"firmware_bin_path": self.firmware_bin_path,
|
||||||
"loaded_integrations": sorted(self.loaded_integrations),
|
"loaded_integrations": sorted(self.loaded_integrations),
|
||||||
"no_mdns": self.no_mdns,
|
"no_mdns": self.no_mdns,
|
||||||
|
"framework": self.framework,
|
||||||
|
"core_platform": self.core_platform,
|
||||||
}
|
}
|
||||||
|
|
||||||
def to_json(self):
|
def to_json(self):
|
||||||
@ -127,6 +135,8 @@ class StorageJSON:
|
|||||||
and CONF_DISABLED in esph.config[CONF_MDNS]
|
and CONF_DISABLED in esph.config[CONF_MDNS]
|
||||||
and esph.config[CONF_MDNS][CONF_DISABLED] is True
|
and esph.config[CONF_MDNS][CONF_DISABLED] is True
|
||||||
),
|
),
|
||||||
|
framework=esph.target_framework,
|
||||||
|
core_platform=esph.target_platform,
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -147,6 +157,8 @@ class StorageJSON:
|
|||||||
firmware_bin_path=None,
|
firmware_bin_path=None,
|
||||||
loaded_integrations=set(),
|
loaded_integrations=set(),
|
||||||
no_mdns=False,
|
no_mdns=False,
|
||||||
|
framework=None,
|
||||||
|
core_platform=platform.lower(),
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -168,6 +180,8 @@ class StorageJSON:
|
|||||||
firmware_bin_path = storage.get("firmware_bin_path")
|
firmware_bin_path = storage.get("firmware_bin_path")
|
||||||
loaded_integrations = set(storage.get("loaded_integrations", []))
|
loaded_integrations = set(storage.get("loaded_integrations", []))
|
||||||
no_mdns = storage.get("no_mdns", False)
|
no_mdns = storage.get("no_mdns", False)
|
||||||
|
framework = storage.get("framework")
|
||||||
|
core_platform = storage.get("core_platform")
|
||||||
return StorageJSON(
|
return StorageJSON(
|
||||||
storage_version,
|
storage_version,
|
||||||
name,
|
name,
|
||||||
@ -182,6 +196,8 @@ class StorageJSON:
|
|||||||
firmware_bin_path,
|
firmware_bin_path,
|
||||||
loaded_integrations,
|
loaded_integrations,
|
||||||
no_mdns,
|
no_mdns,
|
||||||
|
framework,
|
||||||
|
core_platform,
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -9,6 +9,7 @@ from esphome.config import iter_component_configs, iter_components
|
|||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
ENV_NOGITIGNORE,
|
ENV_NOGITIGNORE,
|
||||||
HEADER_FILE_EXTENSIONS,
|
HEADER_FILE_EXTENSIONS,
|
||||||
|
PLATFORM_ESP32,
|
||||||
SOURCE_FILE_EXTENSIONS,
|
SOURCE_FILE_EXTENSIONS,
|
||||||
__version__,
|
__version__,
|
||||||
)
|
)
|
||||||
@ -107,7 +108,10 @@ def storage_should_clean(old: StorageJSON, new: StorageJSON) -> bool:
|
|||||||
if old.build_path != new.build_path:
|
if old.build_path != new.build_path:
|
||||||
return True
|
return True
|
||||||
if old.loaded_integrations != new.loaded_integrations:
|
if old.loaded_integrations != new.loaded_integrations:
|
||||||
return True
|
if new.core_platform == PLATFORM_ESP32:
|
||||||
|
from esphome.components.esp32 import FRAMEWORK_ESP_IDF
|
||||||
|
|
||||||
|
return new.framework == FRAMEWORK_ESP_IDF
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user