iprak / yahoofinance

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

Url to stock chart #84

Closed Tom-ahawk closed 2 years ago

Tom-ahawk commented 2 years ago

Using your integration for quick look at my main stocks. Would be nice to have a stock attribute in the form as an url to Yahoo charts for the stock.

iprak commented 2 years ago

I feel this is a very specific use case. The chart url for a symebol is just https://finance.yahoo.com/chart/symbol. How are you planning to use the url?

Tom-ahawk commented 2 years ago

Using:

type: custom:flex-table-card
entities:
  include: sensor.yahoofinance*
columns:
  - name: Trend
    data: icon
  - name: Råvarer
    data: friendly_name
  - name: Pris $US
    data: state
  - name: ∆%
    data: regularMarketChangePercent

image

Clicking on the icon or other field containing the url so one can quickly got to the stock chart.

iprak commented 2 years ago

That is a neat card.

I don't know how clickable links can be generate by it but it is through advanced formatting the prefix can be used to generate the url data. - https://github.com/custom-cards/flex-table-card/blob/master/docs/example-cfg-simple-cell-formatting.md

This proposed data attribute feels redundant to me and would like to avoid it since the symbol values can be tracked for longer periods.

Tom-ahawk commented 2 years ago

Got it working like this:

  - name: Link
    data: symbol
    modify: '''<a href=https://finance.yahoo.com/quote/'' + x + ''>Y</a>'''