hudsonbrendon / ha_epic_games

A custom component for home assistant
MIT License
9 stars 6 forks source link

TypeError: 'NoneType' object is not subscriptable #6

Closed ggflempire closed 8 months ago

ggflempire commented 10 months ago

When I add an Epic location to HA I get "TypeError: 'NoneType' object is not subscriptable". I have tried multiple locations (US, UK, DE) but always the same error message in the logs... Any idea what to try?

MatthewThomasRussell commented 8 months ago

I managed to work around this by hardcoding the URL in the sensor.py file

 @property
    def url(self):
        # return f"{BASE_URL}/freeGamesPromotions?locale={self.locale}&country={self.country}&allowCountries={self.allow_countries}"
        return "https://store-site-backend-static.ak.epicgames.com/freeGamesPromotions?locale=en-GB&country=GB&allowCountries=GB"

No clue what exactly is causing the original URL to fail