djtimca / hagooglewifi

Home Assistant integration for Google Wifi systems.
Apache License 2.0
79 stars 26 forks source link

Error setting up googlewifi integration on 2022.4.0b0 #66

Closed thewazz1 closed 2 years ago

thewazz1 commented 2 years ago

Running HA beta 2022.4.0b0 and getting the following error message, and googlewifi will not load

2022-03-31 15:14:16 ERROR (SyncWorker_2) [homeassistant.util.package] Unable to install package grpcio==1.44.0: ERROR: Cannot install grpcio==1.44.0 because these package versions have conflicting dependencies. ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts WARNING: You are using pip version 22.0.3; however, version 22.0.4 is available. You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command. 2022-03-31 15:14:16 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration googlewifi: Requirements for googlewifi not found: ['grpcio==1.44.0'].

djtimca commented 2 years ago

Unfortunately this will need the updated version of grpcio to be released before I can resolve. There is a release candidate out for it, but not released yet. Not sure if the new version will resolve either. Will keep my eye on it.

Mezzle commented 2 years ago

What is this conflicting with? It seems the error message isn't stating

CZonin commented 2 years ago

No additional info to add, but also experiencing this with 2022.4.0

bfish2 commented 2 years ago

Also experiencing on 2022.4.0

j-loewen commented 2 years ago

Also experiencing on 2022.4.0

Yes, same here

Mezzle commented 2 years ago

It seems you're depending on a version of googlewifi that's been yanked from github? Whilst it appears in pypi, if you look at the Github Tags - there's no version there that's linked.

https://github.com/djtimca/googlewifi-api/tags

I'm not 100% sure where the pypi version 0.0.20 has come from, as it doesn't offer a tag, or a diff on pypi, and it seems the new version of grpc has been yanked from release?

It might be worth downgrading it back to 0.0.19 temporarily? Although this will regress #61

There's such a minor difference between the two versions though that it shouldn't make much of a difference...

diff -Naur googlewifi-0.0.20/googlewifi/__init__.py googlewifi-api-0.0.19/googlewifi/__init__.py
--- googlewifi-0.0.20/googlewifi/__init__.py    2022-03-01 16:38:44.000000000 +0000
+++ googlewifi-api-0.0.19/googlewifi/__init__.py    2022-01-18 14:40:02.000000000 +0000
@@ -286,10 +286,9 @@
         if this_station["stationId"] in devices:
           devices[this_station["stationId"]]["macAddress"] = this_station.get("macAddress",{})

-      if system_metrics.get("stationMetrics"):
-        for this_station in system_metrics.get("stationMetrics"):
-          if this_station["station"]["id"] in devices:
-            devices[this_station["station"]["id"]]["traffic"] = this_station.get("traffic",{})
+      for this_station in system_metrics.get("stationMetrics"):
+        if this_station["station"]["id"] in devices:
+          devices[this_station["station"]["id"]]["traffic"] = this_station.get("traffic",{})

       systems[this_system["id"]]["devices"] = devices

1.45.1 of grpcio seems to have been released, just not made it to pypi yet. https://github.com/grpc/grpc/releases/tag/v1.45.1

thewazz1 commented 2 years ago

I did some poking around, and it looks like Home Assistant uses grpcio 1.45.0, even though it was yanked from PyPi. So just to try it out I changed grpcio to 1.45.0 in the manifest.json, and restarted HA. Googlewifi came up and it appears to be working. Since it is included in HA itself, the explicit dependency may even be able to be removed from this custom component.

djtimca commented 2 years ago

Thanks @thewazz1 - was on my list to look at today. Appreciate the troubleshoot! Will get a new release out today.

Mezzle commented 2 years ago

I changed grpcio to 1.45.0 in the manifest.json, and restarted HA. Googlewifi came up and it appears to be working.

This worked for me also. Really appreciate that fix @thewazz1 . Just wish I knew Python etc better to be able to have found this myself!

kreene1987 commented 2 years ago

Worked for me as well!

bfish2 commented 2 years ago

Thanks everyone! Worked for me too!

CZonin commented 2 years ago

All good for me now too after the update. Thanks!