iprak / yahoofinance

Home Assistant component which allows you to get stock updates from Yahoo finance.
MIT License
81 stars 11 forks source link

EUR=X doesn't compute #89

Closed jov58 closed 1 year ago

jov58 commented 1 year ago

Hi,

If I use the symbol EUR=X I get the following errors:

Logger: custom_components.yahoofinance.coordinator
Source: custom_components/yahoofinance/coordinator.py:218
Integration: Yahoo Finance ([documentation](https://github.com/iprak/yahoofinance), [issues](https://github.com/iprak/yahoofinance/issues))
First occurred: 11:22:41 (22 occurrences)
Last logged: 15:54:01

    Received USDEUR=X not in symbol list
    No data received for ['EUR=X']

It looks like EUR=X is defined but USDEUR=X is used to query Yahoo?

iprak commented 1 year ago

If you are trying to get the conversion rate then you would want to list source and target e.g. USDEUR=X.

jov58 commented 1 year ago

Ah thx. So on Yahoo conversions from USD to other currencies do not contain the prefix USD, but I have to use the prefix here. Nice component by the way, thanks for that!

iprak commented 1 year ago

I think the site assume USD as the source currency .. maybe based on request locale. Specifying the source currency would be much cleaner. Thanks.