Skip to content

Commit

Permalink
fix: interpret connected state correctly
Browse files Browse the repository at this point in the history
The code assumed bool() would parse string values, which led to always connected devices. Now the comparison to true yields the correct results.
  • Loading branch information
guerda committed Dec 3, 2023
1 parent 7b24389 commit 686e19a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/aiovodafone/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ async def get_devices_data(self) -> dict[str, VodafoneStationDevice]:

devices_dict = {}
for device in host_json["data"]["hostTbl"]:
connected = bool(device["active"])
connected = device["active"] == "true"
connection_type = (
"WiFi" if "WiFi" in device["layer1interface"] else "Ethernet"
)
Expand Down

0 comments on commit 686e19a

Please # to comment.