Async_add_executor_job : 'NoneType' object is not callable

Hi all,
i’m developing an integration for tplink Omada SDN controller, but i know very little about python (i’m a developer but i had never worked with it).
I implemented all the code outside HomeAssistant and it all works , but when i started building the home assistant integration i started having some issues one of them is this :

File "/config/custom_components/omadatracker/sensor.py", line 267, in async_update
await self._hass.async_add_executor_job(self.api.loginAndGetAps())
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
TypeError: 'NoneType' object is not callable

The method called by “loginAndGetAps” is this defined as :

def loginAndGetAps(self):

and it returns nothing, it just saves the data in a variable inside the “api” object, the method where i have this error is an async method and it is called using the “await” keyword.

thanks in advance,
Paulo f

1 Like