Bump aioambient to 1.1.0 (#33414)
This commit is contained in:
parent
ef61118d49
commit
fe0db80fb8
4 changed files with 3 additions and 23 deletions
|
@ -41,7 +41,6 @@ _LOGGER = logging.getLogger(__name__)
|
||||||
DATA_CONFIG = "config"
|
DATA_CONFIG = "config"
|
||||||
|
|
||||||
DEFAULT_SOCKET_MIN_RETRY = 15
|
DEFAULT_SOCKET_MIN_RETRY = 15
|
||||||
DEFAULT_WATCHDOG_SECONDS = 5 * 60
|
|
||||||
|
|
||||||
TYPE_24HOURRAININ = "24hourrainin"
|
TYPE_24HOURRAININ = "24hourrainin"
|
||||||
TYPE_BAROMABSIN = "baromabsin"
|
TYPE_BAROMABSIN = "baromabsin"
|
||||||
|
@ -342,7 +341,6 @@ class AmbientStation:
|
||||||
self._config_entry = config_entry
|
self._config_entry = config_entry
|
||||||
self._entry_setup_complete = False
|
self._entry_setup_complete = False
|
||||||
self._hass = hass
|
self._hass = hass
|
||||||
self._watchdog_listener = None
|
|
||||||
self._ws_reconnect_delay = DEFAULT_SOCKET_MIN_RETRY
|
self._ws_reconnect_delay = DEFAULT_SOCKET_MIN_RETRY
|
||||||
self.client = client
|
self.client = client
|
||||||
self.stations = {}
|
self.stations = {}
|
||||||
|
@ -359,21 +357,9 @@ class AmbientStation:
|
||||||
async def ws_connect(self):
|
async def ws_connect(self):
|
||||||
"""Register handlers and connect to the websocket."""
|
"""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():
|
def on_connect():
|
||||||
"""Define a handler to fire when the websocket is connected."""
|
"""Define a handler to fire when the websocket is connected."""
|
||||||
_LOGGER.info("Connected to websocket")
|
_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):
|
def on_data(data):
|
||||||
"""Define a handler to fire when the data is received."""
|
"""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}"
|
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():
|
def on_disconnect():
|
||||||
"""Define a handler to fire when the websocket is disconnected."""
|
"""Define a handler to fire when the websocket is disconnected."""
|
||||||
_LOGGER.info("Disconnected from websocket")
|
_LOGGER.info("Disconnected from websocket")
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"name": "Ambient Weather Station",
|
"name": "Ambient Weather Station",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/ambient_station",
|
"documentation": "https://www.home-assistant.io/integrations/ambient_station",
|
||||||
"requirements": ["aioambient==1.0.4"],
|
"requirements": ["aioambient==1.1.0"],
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"codeowners": ["@bachya"]
|
"codeowners": ["@bachya"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,7 +140,7 @@ aio_geojson_nsw_rfs_incidents==0.3
|
||||||
aio_georss_gdacs==0.3
|
aio_georss_gdacs==0.3
|
||||||
|
|
||||||
# homeassistant.components.ambient_station
|
# homeassistant.components.ambient_station
|
||||||
aioambient==1.0.4
|
aioambient==1.1.0
|
||||||
|
|
||||||
# homeassistant.components.asuswrt
|
# homeassistant.components.asuswrt
|
||||||
aioasuswrt==1.2.3
|
aioasuswrt==1.2.3
|
||||||
|
|
|
@ -47,7 +47,7 @@ aio_geojson_nsw_rfs_incidents==0.3
|
||||||
aio_georss_gdacs==0.3
|
aio_georss_gdacs==0.3
|
||||||
|
|
||||||
# homeassistant.components.ambient_station
|
# homeassistant.components.ambient_station
|
||||||
aioambient==1.0.4
|
aioambient==1.1.0
|
||||||
|
|
||||||
# homeassistant.components.asuswrt
|
# homeassistant.components.asuswrt
|
||||||
aioasuswrt==1.2.3
|
aioasuswrt==1.2.3
|
||||||
|
|
Loading…
Add table
Reference in a new issue