michaellunzer / Home-Assistant-Custom-Component-Fortnite

This is a Home-Assistant custom component that pulls Fortnite stats using the python API library from the site fortnitetracker.com
https://github.com/michaellunzer/Home-Assistant-Custom-Component-Fortnite
MIT License
4 stars 3 forks source link

No sensors created, error in logs #16

Open EddieFAF opened 2 years ago

EddieFAF commented 2 years ago

The custom component stopped working for me. I can't really say when it stopped, if it is something in HA that causes it or a change at fortnitetracker. In HA I get the following log:

Logger: homeassistant.components.sensor
Source: custom_components/fortnite/sensor.py:107
Integration: Sensor (documentation, issues)
First occurred: 13:15:48 (3 occurrences)
Last logged: 13:15:48

fortnite: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 736, in async_device_update
    await task
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/fortnite/sensor.py", line 85, in update
    self.data.update_stats()
  File "/config/custom_components/fortnite/sensor.py", line 107, in update_stats
    self.stats = self.fplayer.get_stats(self.mode)
AttributeError: 'FortniteData' object has no attribute 'fplayer'

I'm on HA version core-2022.6.7 and fortnite stats v0.1.2

mitch55500 commented 2 years ago

Hi @EddieFAF, @michaellunzer,

I've got exactly the same error : fortnite: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 477, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 702, in async_device_update await task File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/fortnite/sensor.py", line 85, in update self.data.update_stats() File "/config/custom_components/fortnite/sensor.py", line 107, in update_stats self.stats = self.fplayer.get_stats(self.mode) AttributeError: 'FortniteData' object has no attribute 'fplayer'

Here my config : image

Does it work for you?

michaellunzer commented 2 years ago

Thanks for posting! I missed the first post and have to take a look at this.

Also, I'm happy to merge any pull requests if you want to fix it yourself!

mitch55500 commented 2 years ago

Thanks for your answer.

Sadly, my knows are limited... I can't help you but I can test if you need.

mitch55500 commented 2 years ago

I don't know if that can help you but I play on a PC but with a gamepad. By th way, on fortnitetracker, my stats are in "gamepad".

gsmalleus commented 1 year ago

Did anyone ever get this issue resolved? I am also experiencing the same error in my logs and no sensors are created.

mitch55500 commented 1 year ago

SAdly, I haven't found a solution.

I don't know what wrong with this addon (or maybe with my configuration...)

michaellunzer commented 1 year ago

sorry everyone, I haven't touched this since my last release in 2021 with Home Assistant version 2021.10.6 😅

I'm open to pull requests if someone wants to try and fix it!