JackJPowell / hass-psn

Home Assistant integration for the Playstation Network
https://www.home-assistant.io
MIT License
25 stars 0 forks source link

No trophies sensor #6

Closed SeanPM5 closed 3 months ago

SeanPM5 commented 3 months ago

First off great job on the integration, very useful to see play duration and other stats!

One small issue is that I'm only getting 2 of the 3 entities I'm supposed to. The sensor for trophy count just isn't appearing for me. I thought I might have maybe been rate limited or something, and gave it like an hour (with my PS5 on). The media player and PSN status sensors work fine, but trophies sensor just doesn't appear. I tried reloading the integration, still nothing. I see this in the Home Assistant logs.

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:598
integration: Sensor (documentation, issues)
First occurred: 12:16:21 AM (2 occurrences)
Last logged: 1:03:22 AM

Error adding entity None for domain sensor with platform playstation_network
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 598, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 812, in _async_add_entity
    entry = entity_registry.async_get_or_create(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 863, in async_get_or_create
    initial_options = get_initial_options() if get_initial_options else None
                      ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 417, in get_initial_entity_options
    suggested_unit_of_measurement = self._get_initial_suggested_unit()
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 406, in _get_initial_suggested_unit
    if not self._is_valid_suggested_unit(suggested_unit_of_measurement):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 383, in _is_valid_suggested_unit
    raise ValueError(
ValueError: Entity <class 'custom_components.playstation_network.sensor.PsnSensor'> suggest an incorrect unit of measurement: .
Screen Shot 2024-06-29 at 1 13 53 AM
JackJPowell commented 3 months ago

Hey @SeanPM5,

Would you let me know what version of home assistant you're running?

SeanPM5 commented 3 months ago

Should've mentioned that, my bad. I'm on the beta release channel (version 2024.7.0b5) so that might be the reason.

JackJPowell commented 3 months ago

@SeanPM5 I had a feeling. Good deal. It's fixed in the next release. Guess I need to make sure it's out before Wednesday! Thanks for bringing this to my attention.

SeanPM5 commented 3 months ago

Perfect, thank you!

JackJPowell commented 3 months ago

Finally have the next version out. It contains the fix that was breaking in 2024.7 and brings naming inline with home assistant standards.