galletn / iaqualink

Home Assistant Iaqualink Vacuums Robots
8 stars 1 forks source link

Since installing via HACS - ModelNumber no longer reported #5

Closed ppastur closed 1 year ago

ppastur commented 1 year ago

I noticed recently that the model number was no longer being reported. When I traced it back , I noticed that it was no longer being reported once I reinstalled via HACS. Upon investigation, I realised that sensor.py is missing the following lines;

Line 11

URL_GET_DEVICE_FEATURES="https://prod.zodiac-io.com/devices/v2/"

and lines 134 -141

                    url = URL_GET_DEVICE_FEATURES + self._serial_number + "/features"
                    data = None
                    self._headers = {"Content-Type": "application/json; charset=utf-8", "Connection": "keep-alive", "Accept": "*/*", "Authorization" : self._id_token}
                    response = requests.get(url, headers = self._headers)
                    if response.status_code == 200:
                        data = response.json()
                        self._model = data["model"]
                        self._attributes['model'] = self._model

I manually added those lines into sensor.py and restarted HASS and the model number is now being reported. Would it cause an issue if we re-added that back in?

galletn commented 1 year ago

Yes, added it back but seemed to have not published it on the git yet.

It's back now!

let me know if there are other parts missing!

ppastur commented 1 year ago

I updated integration via HACS and its all good. Thank you!