mirror of
https://github.com/esphome/esphome.git
synced 2025-09-02 19:32:19 +01:00
[core] Only clean build files with esp-idf (#7388)
This commit is contained in:
@@ -48,6 +48,8 @@ class StorageJSON:
|
||||
firmware_bin_path: str,
|
||||
loaded_integrations: set[str],
|
||||
no_mdns: bool,
|
||||
framework: str | None = None,
|
||||
core_platform: str | None = None,
|
||||
) -> None:
|
||||
# Version of the storage JSON schema
|
||||
assert storage_version is None or isinstance(storage_version, int)
|
||||
@@ -78,6 +80,10 @@ class StorageJSON:
|
||||
self.loaded_integrations = loaded_integrations
|
||||
# Is mDNS disabled
|
||||
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):
|
||||
return {
|
||||
@@ -94,6 +100,8 @@ class StorageJSON:
|
||||
"firmware_bin_path": self.firmware_bin_path,
|
||||
"loaded_integrations": sorted(self.loaded_integrations),
|
||||
"no_mdns": self.no_mdns,
|
||||
"framework": self.framework,
|
||||
"core_platform": self.core_platform,
|
||||
}
|
||||
|
||||
def to_json(self):
|
||||
@@ -127,6 +135,8 @@ class StorageJSON:
|
||||
and CONF_DISABLED in esph.config[CONF_MDNS]
|
||||
and esph.config[CONF_MDNS][CONF_DISABLED] is True
|
||||
),
|
||||
framework=esph.target_framework,
|
||||
core_platform=esph.target_platform,
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
@@ -147,6 +157,8 @@ class StorageJSON:
|
||||
firmware_bin_path=None,
|
||||
loaded_integrations=set(),
|
||||
no_mdns=False,
|
||||
framework=None,
|
||||
core_platform=platform.lower(),
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
@@ -168,6 +180,8 @@ class StorageJSON:
|
||||
firmware_bin_path = storage.get("firmware_bin_path")
|
||||
loaded_integrations = set(storage.get("loaded_integrations", []))
|
||||
no_mdns = storage.get("no_mdns", False)
|
||||
framework = storage.get("framework")
|
||||
core_platform = storage.get("core_platform")
|
||||
return StorageJSON(
|
||||
storage_version,
|
||||
name,
|
||||
@@ -182,6 +196,8 @@ class StorageJSON:
|
||||
firmware_bin_path,
|
||||
loaded_integrations,
|
||||
no_mdns,
|
||||
framework,
|
||||
core_platform,
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
|
Reference in New Issue
Block a user