Just thought I’d post this as it ended up being the exact solution I was looking for. I did end up having to create a custom component but thanks to a push in the right direction from @VDRainer creating the sensor turned out to be pretty simple.
CSV needs to have the attribute names as the first line.
"name","url","image_url"
"Flex 98.5 - Hip Hop","https://streaming.live365.com/a23768","https://media.live365.com/download/a255d860-3c9d-4aad-8a6c-867e082b1861.jpeg"
"Flood FM","https://streaming.live365.com/a78844","https://media.live365.com/download/45adbb09-c946-4711-8438-c12545cd9f92.png"
"That 70's Channel","https://ais-edge37-live365-dal02.cdnstream.com/a09646","https://media.live365.com/download/bb807a58-fc07-4d1e-bda8-d814078f4113.png"
"All Memphis Music","https://streaming.live365.com/a77318","https://media.live365.com/download/0a8a7b54-9b45-487a-a0e1-3be601806688.jpeg"
CSV reader returns a dictionary object of the csv file.
import csv
csv_file = (
"/config/custom_components/streaming_radio_player/user_data/streaming_radio_stations.csv"
)
csv_reader = csv.DictReader(open(csv_file), delimiter=",")
station_list = [dict(d) for d in csv_reader]
And then in the sensor definition just pass that dictionary object to the sensor attributes.
self._attributes["stations"] = station_list
Easy peasy nice and sleasy!