diff --git a/homeassistant/components/ambient_station/__init__.py b/homeassistant/components/ambient_station/__init__.py index b840a1b7171..f3f2397d214 100644 --- a/homeassistant/components/ambient_station/__init__.py +++ b/homeassistant/components/ambient_station/__init__.py @@ -41,7 +41,6 @@ _LOGGER = logging.getLogger(__name__) DATA_CONFIG = "config" DEFAULT_SOCKET_MIN_RETRY = 15 -DEFAULT_WATCHDOG_SECONDS = 5 * 60 TYPE_24HOURRAININ = "24hourrainin" TYPE_BAROMABSIN = "baromabsin" @@ -342,7 +341,6 @@ class AmbientStation: self._config_entry = config_entry self._entry_setup_complete = False self._hass = hass - self._watchdog_listener = None self._ws_reconnect_delay = DEFAULT_SOCKET_MIN_RETRY self.client = client self.stations = {} @@ -359,21 +357,9 @@ class AmbientStation: async def ws_connect(self): """Register handlers and connect to the websocket.""" - async def _ws_reconnect(event_time): - """Forcibly disconnect from and reconnect to the websocket.""" - _LOGGER.debug("Watchdog expired; forcing socket reconnection") - await self.client.websocket.disconnect() - await self._attempt_connect() - def on_connect(): """Define a handler to fire when the websocket is connected.""" _LOGGER.info("Connected to websocket") - _LOGGER.debug("Watchdog starting") - if self._watchdog_listener is not None: - self._watchdog_listener() - self._watchdog_listener = async_call_later( - self._hass, DEFAULT_WATCHDOG_SECONDS, _ws_reconnect - ) def on_data(data): """Define a handler to fire when the data is received.""" @@ -385,12 +371,6 @@ class AmbientStation: self._hass, f"ambient_station_data_update_{mac_address}" ) - _LOGGER.debug("Resetting watchdog") - self._watchdog_listener() - self._watchdog_listener = async_call_later( - self._hass, DEFAULT_WATCHDOG_SECONDS, _ws_reconnect - ) - def on_disconnect(): """Define a handler to fire when the websocket is disconnected.""" _LOGGER.info("Disconnected from websocket") diff --git a/homeassistant/components/ambient_station/manifest.json b/homeassistant/components/ambient_station/manifest.json index a6572070a5e..8c4bc1b3cc0 100644 --- a/homeassistant/components/ambient_station/manifest.json +++ b/homeassistant/components/ambient_station/manifest.json @@ -3,7 +3,7 @@ "name": "Ambient Weather Station", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/ambient_station", - "requirements": ["aioambient==1.0.4"], + "requirements": ["aioambient==1.1.0"], "dependencies": [], "codeowners": ["@bachya"] } diff --git a/requirements_all.txt b/requirements_all.txt index 9360ccc9bf8..94ce70f6e4e 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -140,7 +140,7 @@ aio_geojson_nsw_rfs_incidents==0.3 aio_georss_gdacs==0.3 # homeassistant.components.ambient_station -aioambient==1.0.4 +aioambient==1.1.0 # homeassistant.components.asuswrt aioasuswrt==1.2.3 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 3861268e0a7..f8ff29221ac 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -47,7 +47,7 @@ aio_geojson_nsw_rfs_incidents==0.3 aio_georss_gdacs==0.3 # homeassistant.components.ambient_station -aioambient==1.0.4 +aioambient==1.1.0 # homeassistant.components.asuswrt aioasuswrt==1.2.3