File tree 2 files changed +8
-2
lines changed
custom_components/petsafe
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,7 @@ def __init__(
237
237
self ._litterboxes : list [petsafe .devices .DeviceScoopfree ] = None
238
238
self ._device_lock = asyncio .Lock ()
239
239
self .entry = entry
240
+ self ._authErrorCount = 0
240
241
241
242
async def get_feeders (self ) -> list [petsafe .devices .DeviceSmartFeed ]:
242
243
"""Return the list of feeders."""
@@ -270,10 +271,15 @@ async def _async_update_data(self) -> PetSafeData:
270
271
async with self ._device_lock :
271
272
self ._feeders = await self .api .get_feeders ()
272
273
self ._litterboxes = await self .api .get_litterboxes ()
274
+ self ._authErrorCount = 0
273
275
return PetSafeData (self ._feeders , self ._litterboxes )
274
276
except httpx .HTTPStatusError as ex :
275
277
if ex .response .status_code in (401 , 403 ):
276
- raise ConfigEntryAuthFailed () from ex
278
+ self ._authErrorCount += 1
279
+ if self ._authErrorCount >= 5 :
280
+ self ._authErrorCount = 0
281
+ raise ConfigEntryAuthFailed () from ex
282
+
277
283
else :
278
284
raise UpdateFailed () from ex
279
285
except Exception as ex :
Original file line number Diff line number Diff line change 1
1
{
2
- "version" : " 1.3.4 " ,
2
+ "version" : " 1.3.5 " ,
3
3
"domain" : " petsafe" ,
4
4
"name" : " PetSafe" ,
5
5
"config_flow" : true ,
You can’t perform that action at this time.
0 commit comments