@@ -185,6 +185,7 @@ def get_initial_timeout(self) -> int:
185185 async def initialize (
186186 self , writer : Callable [[Message ], Awaitable [None ]], controller : Controller
187187 ) -> None :
188+ self ._controller = controller
188189 self ._log = logging .getLogger ("velbus-module" )
189190 # load the protocol data
190191 try :
@@ -301,21 +302,21 @@ def calc_channel_offset(self, address: int) -> int:
301302 return _channel_offset
302303
303304 def on_connect (self , meth : Callable [[], Awaitable [None ]]) -> None :
304- self .controller ._add_on_connext_callback (meth )
305+ self ._controller ._add_on_connext_callback (meth )
305306
306307 def remove_on_connect (self , meth : Callable [[], Awaitable [None ]]) -> None :
307- self .controller ._remove_on_connect_callback (meth )
308+ self ._controller ._remove_on_connect_callback (meth )
308309
309310 def on_disconnect (self , meth : Callable [[], Awaitable [None ]]) -> None :
310- self .controller ._add_on_disconnect_callback (meth )
311+ self ._controller ._add_on_disconnect_callback (meth )
311312
312313 def remove_on_disconnect (self , meth : Callable [[], Awaitable [None ]]) -> None :
313- self .controller ._remove_on_disconnect_callback (meth )
314+ self ._controller ._remove_on_disconnect_callback (meth )
314315
315316 @property
316317 def is_connected (self ) -> bool :
317318 """Return if the module is connected."""
318- return self .controller .connected ()
319+ return self ._controller .connected
319320
320321 async def on_message (self , message : Message ) -> None :
321322 """Process received message"""
0 commit comments