RobertD502 / home-assistant-flair

Custom component for Home Assistant Core for Flair pucks, vents, rooms, structures, and minisplits
MIT License
90 stars 12 forks source link

'NoneType' object is not subscriptable #37

Closed tsuckow closed 1 year ago

tsuckow commented 1 year ago

Trying to setup Flair for the first time. Tried 0.1.3 and 0.1.4

Logger: custom_components.flair Source: custom_components/flair/coordinator.py:46 Integration: Flair (documentation, issues) First occurred: 5:53:50 PM (7 occurrences) Last logged: 5:56:08 PM

Unexpected error fetching flair data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/config/custom_components/flair/coordinator.py", line 46, in _async_update_data data = await self.client.get_flair_data() File "/usr/local/lib/python3.10/site-packages/flairaio/flair_client.py", line 355, in get_flair_data get_reading = await self.get_related(vent_object, 'current-reading') File "/usr/local/lib/python3.10/site-packages/flairaio/flair_client.py", line 416, in get_related return response['data'] TypeError: 'NoneType' object is not subscriptable

RobertD502 commented 1 year ago

Can you please forward your OAuth2.0 credentials to flairhass at gmail dot com.

Based on the Log, there doesn't seem to be a current-reading endpoint for the vent, which shouldn't be the case. I'll need to see what is being returned using your credentials.

tsuckow commented 1 year ago

The one vent I have isn't powered on since I actually just moved and haven't installed it yet.

I'll see about putting the batteries back in it.

On Thu, Oct 6, 2022, 18:16 Robert Drinovac @.***> wrote:

Can you please forward your OAuth2.0 credentials to flairhass at gmail dot com.

Based on the Log, there doesn't seem to be a current-reading endpoint for the vent, which shouldn't be the case. I'll need to see what is being returned using your credentials.

— Reply to this email directly, view it on GitHub https://github.com/RobertD502/home-assistant-flair/issues/37#issuecomment-1270984039, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACACJ6U2Q4F3JPT42X2UHTWB52YJANCNFSM6AAAAAAQ7EJXDE . You are receiving this because you authored the thread.Message ID: @.***>

RobertD502 commented 1 year ago

Well that's good to know. I'll add a safety check into the backend that doesn't add vents if they aren't online during setup.

RobertD502 commented 1 year ago

You can either put in batteries or wait until tomorrow when I push out a new update.

RobertD502 commented 1 year ago

@tsuckow Fixed in release 0.1.5. The vent that isn't powered on will show as being unavailable until it is powered on.

tsuckow commented 1 year ago

Does indeed seem to behave on 0.1.5. Thanks!