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
@@ -61,6 +61,6 @@ SN74HC595_INPUT_PIN_SCHEMA = cv.Schema({})
@pins.PIN_SCHEMA_REGISTRY.register(
CONF_SN74HC595, (SN74HC595_OUTPUT_PIN_SCHEMA, SN74HC595_INPUT_PIN_SCHEMA)
)
def sn74hc595_pin_to_code(config):
parent = yield cg.get_variable(config[CONF_SN74HC595])
yield SN74HC595GPIOPin.new(parent, config[CONF_NUMBER], config[CONF_INVERTED])
async def sn74hc595_pin_to_code(config):
parent = await cg.get_variable(config[CONF_SN74HC595])
return SN74HC595GPIOPin.new(parent, config[CONF_NUMBER], config[CONF_INVERTED])