Problem parsing get_library results #3435
-
Using the HACS integration, I was able to use the mass.get_library function to get a list of Artists and use them as the options for an Input Select control. Since moving to the core integration, it appears that the content of the response variable is now different, as my code no longer works. Before, I was simply doing something like this (don't remember the exact field names of the old version, but along these lines):
I am able to get a response from the library such as the following:
I recognize that the response now includes the results in addition to the search parameters. I have no problem returning a single value such as the search offset, order, limit, etc. from the response. However, I've tried all sorts of ways to get a list of Artist names (...items.name, items().name, items[].name, etc.) Is anyone able to successfully parse the response and get a list of artists, albums, etc.? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I am not sure of the problem. This is a excerpt of my get_library action
You haven’t provided your full automation but assuming the response variable is search_results something like this should work although I haven’t tested it.
Which is basically the same as what you were doing? |
Beta Was this translation helpful? Give feedback.
Actually I have seen this before. It exceeds my knowledge to know why but items needs to be in quotes. I do this stuff in the template tester in the dev tools so you can paste the following in and then adjust for the exact output you want