Fix modbus register (#806)

Fixes https://github.com/esphome/feature-requests/issues/49#issuecomment-546555289

Co-Authored-By: tsunglung <tsunglung@users.noreply.github.com>
This commit is contained in:
Otto Winter 2019-10-27 12:30:36 +01:00 committed by GitHub
parent b0bb692af4
commit 969bdb06ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,3 +41,4 @@ def register_modbus_device(var, config):
parent = yield cg.get_variable(config[CONF_MODBUS_ID]) parent = yield cg.get_variable(config[CONF_MODBUS_ID])
cg.add(var.set_parent(parent)) cg.add(var.set_parent(parent))
cg.add(var.set_address(config[CONF_ADDRESS])) cg.add(var.set_address(config[CONF_ADDRESS]))
cg.add(parent.register_device(var))