Remove old unused code in mcp23xxx_base (#3685)

This commit is contained in:
Jesse Hills 2022-08-07 09:56:52 +12:00 committed by GitHub
parent 8546ae56da
commit e246ebfb2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,7 +19,6 @@ CODEOWNERS = ["@jesserockz"]
mcp23xxx_base_ns = cg.esphome_ns.namespace("mcp23xxx_base") mcp23xxx_base_ns = cg.esphome_ns.namespace("mcp23xxx_base")
MCP23XXXBase = mcp23xxx_base_ns.class_("MCP23XXXBase", cg.Component) MCP23XXXBase = mcp23xxx_base_ns.class_("MCP23XXXBase", cg.Component)
MCP23XXXGPIOPin = mcp23xxx_base_ns.class_("MCP23XXXGPIOPin", cg.GPIOPin) MCP23XXXGPIOPin = mcp23xxx_base_ns.class_("MCP23XXXGPIOPin", cg.GPIOPin)
MCP23XXXGPIOMode = mcp23xxx_base_ns.enum("MCP23XXXGPIOMode")
MCP23XXXInterruptMode = mcp23xxx_base_ns.enum("MCP23XXXInterruptMode") MCP23XXXInterruptMode = mcp23xxx_base_ns.enum("MCP23XXXInterruptMode")
MCP23XXX_INTERRUPT_MODES = { MCP23XXX_INTERRUPT_MODES = {
@ -29,12 +28,6 @@ MCP23XXX_INTERRUPT_MODES = {
"FALLING": MCP23XXXInterruptMode.MCP23XXX_FALLING, "FALLING": MCP23XXXInterruptMode.MCP23XXX_FALLING,
} }
MCP23XXX_GPIO_MODES = {
"INPUT": MCP23XXXGPIOMode.MCP23XXX_INPUT,
"INPUT_PULLUP": MCP23XXXGPIOMode.MCP23XXX_INPUT_PULLUP,
"OUTPUT": MCP23XXXGPIOMode.MCP23XXX_OUTPUT,
}
MCP23XXX_CONFIG_SCHEMA = cv.Schema( MCP23XXX_CONFIG_SCHEMA = cv.Schema(
{ {
cv.Optional(CONF_OPEN_DRAIN_INTERRUPT, default=False): cv.boolean, cv.Optional(CONF_OPEN_DRAIN_INTERRUPT, default=False): cv.boolean,
@ -95,20 +88,3 @@ async def mcp23xxx_pin_to_code(config):
cg.add(var.set_flags(pins.gpio_flags_expr(config[CONF_MODE]))) cg.add(var.set_flags(pins.gpio_flags_expr(config[CONF_MODE])))
cg.add(var.set_interrupt_mode(config[CONF_INTERRUPT])) cg.add(var.set_interrupt_mode(config[CONF_INTERRUPT]))
return var return var
# BEGIN Removed pin schemas below to show error in configuration
# TODO remove in 2022.5.0
for id in ["mcp23008", "mcp23s08", "mcp23017", "mcp23s17"]:
invalid_schema = cv.invalid(
f"'{id}:' has been removed from the pin schema in 1.17.0, please use 'mcp23xxx:'"
)
# pylint: disable=cell-var-from-loop
@pins.PIN_SCHEMA_REGISTRY.register(id, invalid_schema)
def pin_to_code(config):
pass
# END Removed pin schemas