From 969bdb06ce105c60c655138ebf7715a92fe2d3e6 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sun, 27 Oct 2019 12:30:36 +0100 Subject: [PATCH] Fix modbus register (#806) Fixes https://github.com/esphome/feature-requests/issues/49#issuecomment-546555289 Co-Authored-By: tsunglung --- esphome/components/modbus/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/esphome/components/modbus/__init__.py b/esphome/components/modbus/__init__.py index 88105b7baf..cada835905 100644 --- a/esphome/components/modbus/__init__.py +++ b/esphome/components/modbus/__init__.py @@ -41,3 +41,4 @@ def register_modbus_device(var, config): parent = yield cg.get_variable(config[CONF_MODBUS_ID]) cg.add(var.set_parent(parent)) cg.add(var.set_address(config[CONF_ADDRESS])) + cg.add(parent.register_device(var))