mirror of
https://github.com/esphome/esphome.git
synced 2025-10-04 19:03:47 +01:00
Add validate to components (#1631)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
482a3aebc9
commit
c79d700d03
@@ -24,3 +24,8 @@ async def to_code(config):
|
||||
var = cg.new_Pvariable(config[CONF_ID])
|
||||
await rc522.setup_rc522(var, config)
|
||||
await spi.register_spi_device(var, config)
|
||||
|
||||
|
||||
def validate(config, item_config):
|
||||
# validate given SPI hub is suitable for rc522_spi, it needs both miso and mosi
|
||||
spi.validate_device("rc522_spi", config, item_config, True, True)
|
||||
|
Reference in New Issue
Block a user