Exemplo n.º 1
0
    def test_esp8266_warning(self, core_esp8266, caplog, value):
        caplog.at_level(logging.WARNING)
        pins.validate_gpio_pin(value)

        assert len(caplog.messages) == 1
        assert caplog.messages[0].endswith(
            "flash interface in QUAD IO flash mode.")
Exemplo n.º 2
0
def validate_touch_pad(value):
    value = validate_gpio_pin(value)
    if value not in TOUCH_PADS:
        raise cv.Invalid(f"Pin {value} does not support touch pads.")
    return value
Exemplo n.º 3
0
def validate_touch_pad(value):
    value = validate_gpio_pin(value)
    if value not in TOUCH_PADS:
        raise vol.Invalid("Pin {} does not support touch pads.".format(value))
    return value
Exemplo n.º 4
0
    def test_unknown_device(self, core):
        core.esp_platform = UNKNOWN_PLATFORM

        with pytest.raises(NotImplementedError):
            pins.validate_gpio_pin("0")
Exemplo n.º 5
0
 def test_esp8266_invalid_pin(self, core_esp8266, value, match):
     with pytest.raises(Invalid, match=match):
         pins.validate_gpio_pin(value)
Exemplo n.º 6
0
    def test_esp8266_valid(self, core_esp8266):
        actual = pins.validate_gpio_pin("GPIO12")

        assert actual == 12
Exemplo n.º 7
0
    def test_esp32_valid(self, core_esp32):
        actual = pins.validate_gpio_pin("GPIO22")

        assert actual == 22