Skip to content

Add device info metadata for Yahoo Finance sensors#194

Open
eugenetsi wants to merge 2 commits intoiprak:masterfrom
eugenetsi:master
Open

Add device info metadata for Yahoo Finance sensors#194
eugenetsi wants to merge 2 commits intoiprak:masterfrom
eugenetsi:master

Conversation

@eugenetsi
Copy link

Summary

  • register each Yahoo Finance sensor as a device by exposing device_info with identifiers,
    manufacturer and a link back to the Yahoo quote page
  • introduce YAHOO_QUOTE_URL so configuration URLs are consistent
  • add a pytest config (asyncio_mode = auto) so Home Assistant fixtures run without
    async_generator errors
  • cover the new behavior with test_device_info_exposes_symbol_details

Testing

  • pytest tests/test_sensor.py -k device_info_exposes_symbol_details
  • pytest

@iprak
Copy link
Owner

iprak commented Dec 30, 2025

Would you mind adding the usage of this PR? It is to have the link to view more details?

Copy link
Owner

@iprak iprak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would help if you explain the purpose of the PR and how to access the device info. As I understand, since the integration cannot be configured from UI, so the device info cannot be accessed in UI.

@eugenetsi
Copy link
Author

It would help if you explain the purpose of the PR and how to access the device info. As I understand, since the integration cannot be configured from UI, so the device info cannot be accessed in UI.

Even for YAML-only integrations, HA still registers a device record when device_info is provided.
After restarting, each ticker shows up under Settings -> Devices & Services -> Entities (filter by “Yahoo Finance” or the symbol). Clicking any entity shows the “Device info” panel on the right, including the new “Yahoo Finance ” device entry; you can follow the configuration URL, disable the device, etc. That’s what this PR enables—the sensor entities are no longer “orphans” in the registry.

@iprak
Copy link
Owner

iprak commented Dec 30, 2025

It would help if you explain the purpose of the PR and how to access the device info. As I understand, since the integration cannot be configured from UI, so the device info cannot be accessed in UI.

Even for YAML-only integrations, HA still registers a device record when device_info is provided. After restarting, each ticker shows up under Settings -> Devices & Services -> Entities (filter by “Yahoo Finance” or the symbol). Clicking any entity shows the “Device info” panel on the right, including the new “Yahoo Finance ” device entry; you can follow the configuration URL, disable the device, etc. That’s what this PR enables—the sensor entities are no longer “orphans” in the registry.

That is exactly what I thought was the intent. But I am not seeing anything in the Device column or Devices tab or under the kebab menu where Service info appears. Could there some other change ? I suspect that I might be missing something? I never hit my breakpoint on device_info and have confirmed that I have the correct code by introduce syntax error in device_info. I am on 2025.12.4.

This is what I see
image

The device registry wiki https://developers.home-assistant.io/docs/device_registry_index/ confirms that device info is only read for config entry which is for setup via UI.

@iprak iprak self-requested a review December 30, 2025 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants