mirror of
https://github.com/esphome/esphome.git
synced 2024-12-12 08:24:55 +01:00
Merge branch 'dev' into platform
This commit is contained in:
commit
eba4b18ad9
5 changed files with 25 additions and 15 deletions
|
@ -67,8 +67,10 @@ def _translate_pin(value):
|
|||
"This variable only supports pin numbers, not full pin schemas "
|
||||
"(with inverted and mode)."
|
||||
)
|
||||
if isinstance(value, int):
|
||||
if isinstance(value, int) and not isinstance(value, bool):
|
||||
return value
|
||||
if not isinstance(value, str):
|
||||
raise cv.Invalid(f"Invalid pin number: {value}")
|
||||
try:
|
||||
return int(value)
|
||||
except ValueError:
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
import logging
|
||||
from dataclasses import dataclass
|
||||
import logging
|
||||
|
||||
from esphome import pins
|
||||
import esphome.codegen as cg
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import (
|
||||
CONF_ANALOG,
|
||||
CONF_ID,
|
||||
|
@ -14,10 +17,7 @@ from esphome.const import (
|
|||
CONF_PULLUP,
|
||||
PLATFORM_ESP8266,
|
||||
)
|
||||
from esphome import pins
|
||||
from esphome.core import CORE, coroutine_with_priority
|
||||
import esphome.config_validation as cv
|
||||
import esphome.codegen as cg
|
||||
|
||||
from . import boards
|
||||
from .const import KEY_BOARD, KEY_ESP8266, KEY_PIN_INITIAL_STATES, esp8266_ns
|
||||
|
@ -48,8 +48,10 @@ def _translate_pin(value):
|
|||
"This variable only supports pin numbers, not full pin schemas "
|
||||
"(with inverted and mode)."
|
||||
)
|
||||
if isinstance(value, int):
|
||||
if isinstance(value, int) and not isinstance(value, bool):
|
||||
return value
|
||||
if not isinstance(value, str):
|
||||
raise cv.Invalid(f"Invalid pin number: {value}")
|
||||
try:
|
||||
return int(value)
|
||||
except ValueError:
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
import logging
|
||||
|
||||
from esphome import pins
|
||||
import esphome.codegen as cg
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import (
|
||||
CONF_ID,
|
||||
CONF_INPUT,
|
||||
|
@ -11,9 +14,6 @@ from esphome.const import (
|
|||
CONF_PULLDOWN,
|
||||
CONF_PULLUP,
|
||||
)
|
||||
from esphome import pins
|
||||
import esphome.config_validation as cv
|
||||
import esphome.codegen as cg
|
||||
|
||||
from .const import host_ns
|
||||
|
||||
|
@ -28,8 +28,10 @@ def _translate_pin(value):
|
|||
"This variable only supports pin numbers, not full pin schemas "
|
||||
"(with inverted and mode)."
|
||||
)
|
||||
if isinstance(value, int):
|
||||
if isinstance(value, int) and not isinstance(value, bool):
|
||||
return value
|
||||
if not isinstance(value, str):
|
||||
raise cv.Invalid(f"Invalid pin number: {value}")
|
||||
try:
|
||||
return int(value)
|
||||
except ValueError:
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import logging
|
||||
|
||||
from esphome import pins
|
||||
import esphome.codegen as cg
|
||||
import esphome.config_validation as cv
|
||||
from esphome import pins
|
||||
from esphome.const import (
|
||||
CONF_ANALOG,
|
||||
CONF_ID,
|
||||
|
@ -103,8 +103,10 @@ def _translate_pin(value):
|
|||
"This variable only supports pin numbers, not full pin schemas "
|
||||
"(with inverted and mode)."
|
||||
)
|
||||
if isinstance(value, int):
|
||||
if isinstance(value, int) and not isinstance(value, bool):
|
||||
return value
|
||||
if not isinstance(value, str):
|
||||
raise cv.Invalid(f"Invalid pin number: {value}")
|
||||
try:
|
||||
return int(value)
|
||||
except ValueError:
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
from esphome import pins
|
||||
import esphome.codegen as cg
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import (
|
||||
CONF_ANALOG,
|
||||
CONF_ID,
|
||||
CONF_INPUT,
|
||||
CONF_INVERTED,
|
||||
|
@ -10,10 +12,8 @@ from esphome.const import (
|
|||
CONF_OUTPUT,
|
||||
CONF_PULLDOWN,
|
||||
CONF_PULLUP,
|
||||
CONF_ANALOG,
|
||||
)
|
||||
from esphome.core import CORE
|
||||
from esphome import pins
|
||||
|
||||
from . import boards
|
||||
from .const import KEY_BOARD, KEY_RP2040, rp2040_ns
|
||||
|
@ -41,8 +41,10 @@ def _translate_pin(value):
|
|||
"This variable only supports pin numbers, not full pin schemas "
|
||||
"(with inverted and mode)."
|
||||
)
|
||||
if isinstance(value, int):
|
||||
if isinstance(value, int) and not isinstance(value, bool):
|
||||
return value
|
||||
if not isinstance(value, str):
|
||||
raise cv.Invalid(f"Invalid pin number: {value}")
|
||||
try:
|
||||
return int(value)
|
||||
except ValueError:
|
||||
|
|
Loading…
Reference in a new issue