Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle server disconnection for Vodafone devices #104650

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Handle server disconnection for Vodafone devices
  • Loading branch information
chemelli74 committed Nov 28, 2023
commit c70dcacf6f8c829670adc866fca3a24bb79e2e6b
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