I'm running a Home Assistant instance in a Docker container with an integration I'm working on connecting to a local device.
My Python looks like this, which I've tested directly on my Windows machine, it runs and connects just fine
if self.session is None:
self.session = aiohttp.ClientSession()
self._close_session = True
try:
async with async_timeout.timeout(self.request_timeout):
response = await self.session.request(method, url, json=data)
LOGGER.info(response)
When running this in the container however, it fails to connect. The IP of my Windows machine is 192.168.1.174
, the IP of the device I'm trying to connect to is 192.168.1.190
. I've also tried connecting the container to a Docker network with a 192.168.1.0/24
subnet, which gave my container the IP of 192.168.1.2
, but it's still unable to reach the device.
I'm at a loss now as to what the issue could be. Any suggestions please?