Convert components to async-def syntax (#1823)

* Convert components to async-def syntax

* Remove stray @coroutine

* Manual part

* Convert complexer components code to async-def

* Manual cleanup

* More manual cleanup
This commit is contained in:
Otto Winter
2021-05-24 21:45:31 +02:00
committed by GitHub
parent 93d9d4b50a
commit a33bb32874
60 changed files with 592 additions and 633 deletions
+3 -3
View File
@@ -69,8 +69,8 @@ PCF8574_INPUT_PIN_SCHEMA = cv.Schema(
@pins.PIN_SCHEMA_REGISTRY.register(
"pcf8574", (PCF8574_OUTPUT_PIN_SCHEMA, PCF8574_INPUT_PIN_SCHEMA)
)
def pcf8574_pin_to_code(config):
parent = yield cg.get_variable(config[CONF_PCF8574])
yield PCF8574GPIOPin.new(
async def pcf8574_pin_to_code(config):
parent = await cg.get_variable(config[CONF_PCF8574])
return PCF8574GPIOPin.new(
parent, config[CONF_NUMBER], config[CONF_MODE], config[CONF_INVERTED]
)