pantherale0 / ha-nintendoparentalcontrols

Home Assistant integration for Nintendo Switch Parental Controls
MIT License
89 stars 7 forks source link

Error Updating device #64

Closed evilmumi closed 10 months ago

evilmumi commented 10 months ago

System Health details

Core 2024.1.2 Supervisor 2023.12.0 Operating System 11.3 Frontend 20240104.0

Checklist

Nintendo Parental Controls mobile app

Describe the issue

In the log there are issues listed.

2024-01-09 09:27:28.349 WARNING (MainThread) [pynintendoparental] Unable to update daily summary for device Tims Switch: A summary for the given date 2024-01-07 20:58:33.618575 does not exist 2024-01-09 09:27:28.350 ERROR (MainThread) [pynintendoparental] Error updating device 44db874f2af36c69: cannot access local variable 'err' where it is not associated with a value 2024-01-09 09:28:29.464 WARNING (MainThread) [pynintendoparental] Unable to update daily summary for device Tims Switch: A summary for the given date 2024-01-07 20:58:33.618575 does not exist 2024-01-09 09:28:29.464 ERROR (MainThread) [pynintendoparental] Error updating device 44db874f2af36c69: cannot access local variable 'err' where it is not associated with a value

Reproduction steps

just open log

Debug logs

needed?

Diagnostics dump

No response

pantherale0 commented 10 months ago

Hi,

Please enable debug logs by adding this into your configuration.yaml and restarting:

  default: info
  logs:
    custom_components.nintendo_parental: debug
    pynintendoparental: debug

Then upload the Home Assistant logs so I can take a look.

Its worth noting if the Nintendo Switch has only recently been added to Parental Controls / is new, you might need to wait at least a month first as a large amount of required data isn't available yet (limitation with the API).

Thanks

evilmumi commented 10 months ago

I wanted to try it. But yaml not valid. Can you please re-check it? So i activated it in UI and restarted 2024-01-16 21:14:23.045 ERROR (MainThread) [pynintendoparental] Error updating device 44db874f2af36c69: cannot access local variable 'err' where it is not associated with a value cant find any more - where to search?

pantherale0 commented 10 months ago

Apologies, missed a line at the start:

# https://www.home-assistant.io/integrations/logger/
logger:
  default: info
  logs:
    custom_components.nintendo_parental: debug
    pynintendoparental: debug

Usually I've seen this error where Nintendo just isn't providing the data itself. Usually its a temporary too and will resolve itself at some point (sorry, thats not helpful but little I can do if Nintendo doesn't return the data itself). Although I do need to take a look at where cannot access local variable 'err' where it is not associated with a value is coming from.

evilmumi commented 10 months ago

And i shut let run it until the error occurs - it logs now a huge amount of data of all integrations, right?

evilmumi commented 10 months ago

I've collected a lot but i dont get the error - what now?

pantherale0 commented 10 months ago

If the error isn't showing up anymore it's probably because Nintendo just didn't have the data needed for the integration to work at the time.

Disable debug logs (otherwise you might end up with some very large log files).

evilmumi commented 10 months ago

so lets close and wait