Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches

Fetch, verify, and interpret a user-referenced LR1121 transceiver firmware image. More...

Go to the source code of this file.

Classes

class  home_io_control.lr1121_firmware.Lr1121FirmwareError
class  home_io_control.lr1121_firmware.Lr1121FirmwareNotFoundError
class  home_io_control.lr1121_firmware.FirmwareImage

Namespaces

namespace  home_io_control
namespace  home_io_control.lr1121_firmware

Functions

 home_io_control.lr1121_firmware.parse_github_source (value)
 home_io_control.lr1121_firmware.resolve_raw_url (owner, repo, path, ref)
 home_io_control.lr1121_firmware.parse_md5_sidecar (text)
 home_io_control.lr1121_firmware.validate_image_class (path, *, expect_loader)
 home_io_control.lr1121_firmware.parse_version_from_filename (path)
 home_io_control.lr1121_firmware.validate_image (data, url)
 home_io_control.lr1121_firmware.validate_bootloader_reachability (radio_type, has_busy_pin, busy_pin_inverted)
 home_io_control.lr1121_firmware.resolve_target_version (source, target_version)
 home_io_control.lr1121_firmware.classify_bootloader_upgrade_class (target_fw)
 home_io_control.lr1121_firmware.fetch_and_verify (source, ref, checksum_md5, target_version, fetch)

Variables

 home_io_control.lr1121_firmware._GITHUB_SOURCE_RE = re.compile(r"^github://(?P<owner>[^/]+)/(?P<repo>[^/]+)/(?P<path>[^@]+?)(?:@(?P<ref>[^@]+))?$")
 home_io_control.lr1121_firmware._MD5_HEX_RE = re.compile(r"^[0-9a-f]{32}$")
 home_io_control.lr1121_firmware._VERSION_RE = re.compile(r"_(?P<major>[0-9a-f]{2})(?P<minor>[0-9a-f]{2})\.bin$", re.IGNORECASE)
dict home_io_control.lr1121_firmware.KNOWN_BOOTLOADER_REQUIREMENTS
int home_io_control.lr1121_firmware.LR1121_BOOTLOADER_2100 = 0x2100
int home_io_control.lr1121_firmware.LR1121_BOOTLOADER_2101 = 0x2101

Detailed Description

Fetch, verify, and interpret a user-referenced LR1121 transceiver firmware image.

Pure logic with the network fetch injected as a callable, so every function here is testable offline (see scripts/lr1121_firmware/tests/run_tests.py, wired into make lint). Deliberately does NOT import esphome.config_validation: that test runner runs on a bare host Python without ESPHome installed (mirroring scripts/corpus/*.py's independence), so a module-level import esphome... here would break it. Every failure raises Lr1121FirmwareError; init.py is the only place that translates it to cv.Invalid, at the config-validation/codegen boundary where ESPHome is guaranteed to be present.

The goal this module serves is "flash whatever LR1121 transceiver image the user points at", not one specific release (ADR 0020). That is why validate_image() deliberately does not gate on image size (published images range from 65 KB to 245 KB, all legitimate) and why an unparseable filename version is carried through as "unknown" rather than failing the build.

Definition in file lr1121_firmware.py.