I use this package as part of your other project for Home Assistant. In the past 24 hours, HA stopped being able to properly poll my Fi devices (2 collars, 4 bases) - bases were missing entirely, and only 1 collar was available with minimal attribute data. I started to dig into the issue and focused on debugging this package.
When running print(tryfi) normally, I'd receive the following error:
Traceback (most recent call last):
File "/Users/jessicadeen/git/upstream/pytryfi/login.py", line 31, in <module>
print(tryfi)
File "/Users/jessicadeen/git/upstream/pytryfi/pytryfi/__init__.py", line 77, in __str__
petString = petString + f"{p}"
File "/Users/jessicadeen/git/upstream/pytryfi/pytryfi/fiPet.py", line 47, in __str__
return f"Last Updated - {self.lastUpdated} - Pet ID: {self.petId} Name: {self.name} Is Lost: {self.isLost} From: {self.homeCityState} ActivityType: {self.activityType} Located: {self.currLatitude},{self.currLongitude} Last Updated: {self.currStartTime}\n \
File "/Users/jessicadeen/git/upstream/pytryfi/pytryfi/fiPet.py", line 362, in isLost
return self.device.isLost
File "/Users/jessicadeen/git/upstream/pytryfi/pytryfi/fiDevice.py", line 92, in isLost
if self._mode == PET_MODE_LOST:
AttributeError: 'FiDevice' object has no attribute '_mode'. Did you mean: 'mode'?
When running print(tryfi) in debug mode, I noticed the error: DEBUG:pytryfi.fiDevice:tryfi Error: 'batteryHealth'
Further debugging seemed to produce various AttributeErrors such as:
AttributeError("'FiDevice' object has no attribute '_availableLedColors'")
AttributeError("'FiDevice' object has no attribute '_mode'")
AttributeError("'FiDevice' object has no attribute '_availableLedColors'")
etc...
I started with the batteryHealth error after I noticed the JSON payload for info was missing the batteryHealth key entirely:
I commented out references to batteryHealth in fiDevice.py on lines 24 and 60-62, restarted the debugger and the issue seemed to be resolved as the traceback error disappears and I receive the information I would expect without further error.
Further, after manually removing batteryHealth in this package, and restarting my HA instance, all issues there were resolved and all of my devices / bases's attributes were available again.
First, huge thank you for this project!
I use this package as part of your other project for Home Assistant. In the past 24 hours, HA stopped being able to properly poll my Fi devices (2 collars, 4 bases) - bases were missing entirely, and only 1 collar was available with minimal attribute data. I started to dig into the issue and focused on debugging this package.
When running
print(tryfi)
normally, I'd receive the following error:When running
print(tryfi)
in debug mode, I noticed the error:DEBUG:pytryfi.fiDevice:tryfi Error: 'batteryHealth'
Further debugging seemed to produce various AttributeErrors such as:
AttributeError("'FiDevice' object has no attribute '_availableLedColors'")
AttributeError("'FiDevice' object has no attribute '_mode'")
AttributeError("'FiDevice' object has no attribute '_availableLedColors'")
I started with the batteryHealth error after I noticed the JSON payload for
info
was missing thebatteryHealth
key entirely:I commented out references to
batteryHealth
infiDevice.py
on lines 24 and 60-62, restarted the debugger and the issue seemed to be resolved as the traceback error disappears and I receive the information I would expect without further error.Further, after manually removing batteryHealth in this package, and restarting my HA instance, all issues there were resolved and all of my devices / bases's attributes were available again.