GithubHelp home page GithubHelp logo

hudsonbrendon / ha_epic_games Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 5.0 52 KB

A custom component for home assistant

License: MIT License

Dockerfile 3.35% Shell 6.18% Python 90.47%
epic-games free games store

ha_epic_games's Introduction

Hi I'm Hudson Brendon

  • 🔭 I’m currently working on Luizalabs
  • 🌱 I’m currently learning Fastapi
  • 👯 I’m looking to collaborate on automation projects as or Home Assistant

nostr:

npub12g6y7jvexxt4pnzgtzgcpja2qxlj33gm7kvk7wc4x2y0c2pxqc3qkfgs7k

Latest posts from Medium

ha_epic_games's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ha_epic_games's Issues

TypeError: 'NoneType' object is not subscriptable

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?

Metacritic Entry Not Found

Hi,

depending on the games, it might happen that no metacritic entry is available or that they simply cannot be found. If that happens the sensor cant be updated or setup at all if this happens after adding the integration.

I suggest to implement a fallback if the metacritic cannot be found. Unfortunatly, I rarely coded in Python at all. But I think it would be sufficient to wrap these lines with a try-catch (like the one for failed parsing).

search_url = f"https://www.metacritic.com/search/game/{game_name}/results?plats[3]=1&search_type=advanced"
response = requests.get(search_url, headers=self.headers)
response.raise_for_status()

The URL that currently cannot be found: https://www.metacritic.com/search/game/Tandem:%20A%20Tale%20of%20Shadows/results/?plats%5B3%5D=1&search_type=advanced

best regards,
SpiGAndromeda

Release dates not always present, causes no games to display

Expected behavior: Games list updates on poll

Actual behavior: No games are listed, error in log

Log contents:

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:682
integration: Sensor (documentation, issues)
First occurred: 10:49:42 AM (1 occurrences)
Last logged: 10:49:42 AM

epic_games: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 682, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1264, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/epic_games/sensor.py", line 185, in update
    runtime=game["viewableDate"].split("T")[0],
            ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'split'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.