Skip to content

Commit

Permalink
Make connection issue debugging more general
Browse files Browse the repository at this point in the history
  • Loading branch information
amaximus committed Mar 28, 2024
1 parent fef0696 commit 074a53c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion custom_components/water_quality_fvm/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Water Quality FVM",
"documentation": "https://github.com/amaximus/water_quality_fvm",
"issue_tracker": "https://github.com/amaximus/water_quality_fvm/issues",
"version": "0.3.2",
"version": "0.3.3",
"dependencies": [],
"codeowners": ["@amaximus"],
"iot_class": "cloud_polling",
Expand Down
7 changes: 4 additions & 3 deletions custom_components/water_quality_fvm/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from datetime import timedelta
import json
import logging
import time
import voluptuous as vol

from homeassistant.components.sensor import PLATFORM_SCHEMA
Expand All @@ -25,7 +26,7 @@
DEFAULT_ICON = 'mdi:water'
DEFAULT_SSL = True

HTTP_TIMEOUT = 5 # secs
HTTP_TIMEOUT = 15 # secs
MAX_RETRIES = 3
SCAN_INTERVAL = timedelta(hours=1)

Expand Down Expand Up @@ -66,10 +67,10 @@ async def async_get_wqdata(self):
await self._hass.async_add_executor_job(_sleep, 10)
else:
break
except (aiohttp.ContentTypeError, aiohttp.ServerDisconnectedError, asyncio.TimeoutError, aiohttp.ClientConnectorError) as err:
except Exception as err:
rsp1 = ""
_LOGGER.debug("Fetch attempt " + str(i+1) + " failed for " + url)
_LOGGER.error(err)
_LOGGER.error("error: {err} of type: {type(err)}")
await self._hass.async_add_executor_job(_sleep, 10)

rsp = rsp1.split("\n")
Expand Down

0 comments on commit 074a53c

Please sign in to comment.