Increase surepetcare default timeout (#34944)
* add timeout parameter and increase default timeout * remove timeout param * revert BinarySensorDevice to BinarySensorEntity * make isort happy * make isort happy - again
This commit is contained in:
parent
e0bcd0049c
commit
d644b610b7
5 changed files with 9 additions and 4 deletions
|
@ -32,6 +32,7 @@ from .const import (
|
|||
DEFAULT_SCAN_INTERVAL,
|
||||
DOMAIN,
|
||||
SPC,
|
||||
SURE_API_TIMEOUT,
|
||||
TOPIC_UPDATE,
|
||||
)
|
||||
|
||||
|
@ -78,6 +79,7 @@ async def async_setup(hass, config) -> bool:
|
|||
conf[CONF_PASSWORD],
|
||||
hass.loop,
|
||||
async_get_clientsession(hass),
|
||||
api_timeout=SURE_API_TIMEOUT,
|
||||
)
|
||||
await surepy.get_data()
|
||||
except SurePetcareAuthenticationError:
|
||||
|
|
|
@ -105,7 +105,7 @@ class SurePetcareBinarySensor(BinarySensorEntity):
|
|||
return None if not self._device_class else self._device_class
|
||||
|
||||
@property
|
||||
def unique_id(self: BinarySensorEntity) -> str:
|
||||
def unique_id(self) -> str:
|
||||
"""Return an unique ID."""
|
||||
return f"{self._spc_data['household_id']}-{self._id}"
|
||||
|
||||
|
@ -214,7 +214,7 @@ class DeviceConnectivity(SurePetcareBinarySensor):
|
|||
return f"{self._name}_connectivity"
|
||||
|
||||
@property
|
||||
def unique_id(self: BinarySensorEntity) -> str:
|
||||
def unique_id(self) -> str:
|
||||
"""Return an unique ID."""
|
||||
return f"{self._spc_data['household_id']}-{self._id}-connectivity"
|
||||
|
||||
|
|
|
@ -23,6 +23,9 @@ SURE_IDS = "sure_ids"
|
|||
# platforms
|
||||
TOPIC_UPDATE = f"{DOMAIN}_data_update"
|
||||
|
||||
# sure petcare api
|
||||
SURE_API_TIMEOUT = 15
|
||||
|
||||
# flap
|
||||
BATTERY_ICON = "mdi:battery"
|
||||
SURE_BATT_VOLTAGE_FULL = 1.6 # voltage
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
"name": "Sure Petcare",
|
||||
"documentation": "https://www.home-assistant.io/integrations/surepetcare",
|
||||
"codeowners": ["@benleb"],
|
||||
"requirements": ["surepy==0.2.3"]
|
||||
"requirements": ["surepy==0.2.5"]
|
||||
}
|
||||
|
|
|
@ -2005,7 +2005,7 @@ sucks==0.9.4
|
|||
sunwatcher==0.2.1
|
||||
|
||||
# homeassistant.components.surepetcare
|
||||
surepy==0.2.3
|
||||
surepy==0.2.5
|
||||
|
||||
# homeassistant.components.swiss_hydrological_data
|
||||
swisshydrodata==0.0.3
|
||||
|
|
Loading…
Add table
Reference in a new issue