Skip to content

Commit

Permalink
Handle server disconnection for Vodafone devices (#104650)
Browse files Browse the repository at this point in the history
  • Loading branch information
chemelli74 authored Nov 29, 2023
1 parent 8c56b5e commit 6a87876
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions homeassistant/components/vodafone_station/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ async def _async_update_data(self) -> UpdateCoordinatorDataType:
try:
try:
await self.api.login()
raw_data_devices = await self.api.get_devices_data()
data_sensors = await self.api.get_sensor_data()
await self.api.logout()
except exceptions.CannotAuthenticate as err:
raise ConfigEntryAuthFailed from err
except (
Expand All @@ -117,10 +120,8 @@ async def _async_update_data(self) -> UpdateCoordinatorDataType:
dev_info, utc_point_in_time
),
)
for dev_info in (await self.api.get_devices_data()).values()
for dev_info in (raw_data_devices).values()
}
data_sensors = await self.api.get_sensor_data()
await self.api.logout()
return UpdateCoordinatorDataType(data_devices, data_sensors)

@property
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/vodafone_station/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/vodafone_station",
"iot_class": "local_polling",
"loggers": ["aiovodafone"],
"requirements": ["aiovodafone==0.4.2"]
"requirements": ["aiovodafone==0.4.3"]
}
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ aiounifi==66
aiovlc==0.1.0

# homeassistant.components.vodafone_station
aiovodafone==0.4.2
aiovodafone==0.4.3

# homeassistant.components.waqi
aiowaqi==3.0.1
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ aiounifi==66
aiovlc==0.1.0

# homeassistant.components.vodafone_station
aiovodafone==0.4.2
aiovodafone==0.4.3

# homeassistant.components.waqi
aiowaqi==3.0.1
Expand Down

0 comments on commit 6a87876

Please sign in to comment.