custom-components / sensor.avanza_stock

Custom component to get stock data from Avanza for Home Assistant
MIT License
46 stars 10 forks source link

Use other value than price as state #144

Closed KennyEliasson closed 1 year ago

KennyEliasson commented 1 year ago

Awesome component. Would it be feasible to be able to add configuration so that the state can be taken from some other property? F.ex. changePercent?

That way it should be easier to create dashboards that reacts if a stock is positive or negative with custom colors and or icons.

That way I can skip and create custom binary sensors or try and find custom frontend plugins to make it work.

claha commented 1 year ago

The best way to solve this is probably to create multiple entities, i.e. one for price, one for change etc. I've been thinking about this before, maybe ot is time now...

claha commented 1 year ago

If this ever becomes an official component I will for sure take that approach, but this custom component will not be refactored into that.