mirror of
https://github.com/esphome/esphome.git
synced 2026-10-03 17:55:57 +00:00
[remote_transmitter] ISR-driven transmission and non_blocking support on RTL8720C (#18648)
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
"""non_blocking is family-gated at config validation; the CI build boards never compile
|
||||
the ISR paths, so this gate is the only CI-reachable coverage for the platform matrix."""
|
||||
|
||||
import pytest
|
||||
|
||||
from esphome.components.libretiny.const import (
|
||||
FAMILY_RTL8710B,
|
||||
FAMILY_RTL8720C,
|
||||
KEY_FAMILY,
|
||||
KEY_LIBRETINY,
|
||||
)
|
||||
from esphome.components.remote_transmitter import _validate_non_blocking_platform
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import PlatformFramework
|
||||
from esphome.core import CORE
|
||||
|
||||
from ..types import SetCoreConfigCallable
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("platform_framework", "family", "accepted"),
|
||||
[
|
||||
(PlatformFramework.ESP32_IDF, None, True),
|
||||
(PlatformFramework.RTL87XX_ARDUINO, FAMILY_RTL8720C, True),
|
||||
(PlatformFramework.RTL87XX_ARDUINO, FAMILY_RTL8710B, False),
|
||||
(PlatformFramework.ESP8266_ARDUINO, None, False),
|
||||
],
|
||||
)
|
||||
def test_non_blocking_platform_gate(
|
||||
set_core_config: SetCoreConfigCallable,
|
||||
platform_framework: PlatformFramework,
|
||||
family: str | None,
|
||||
accepted: bool,
|
||||
) -> None:
|
||||
set_core_config(platform_framework)
|
||||
if family is not None:
|
||||
CORE.data[KEY_LIBRETINY] = {KEY_FAMILY: family}
|
||||
if accepted:
|
||||
assert _validate_non_blocking_platform(True) is True
|
||||
else:
|
||||
with pytest.raises(cv.Invalid, match="non_blocking is only supported on"):
|
||||
_validate_non_blocking_platform(True)
|
||||
@@ -2,6 +2,7 @@ remote_transmitter:
|
||||
id: xmitr
|
||||
pin: GPIO12
|
||||
carrier_duty_percent: 50%
|
||||
# non_blocking is rtl8720c-only; the CI board is an RTL8710B
|
||||
|
||||
packages:
|
||||
buttons: !include common-buttons.yaml
|
||||
|
||||
Reference in New Issue
Block a user