Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95925

Having trouble POSTing input_select options with RESTapi

$
0
0

@Curtis_Bishop wrote:

I am using the RESTapi to POST data into an input_select entity, but am having difficulty, not sure if it is a bug or something I’m doing wrong…

In my configuration.yaml, I have an input_select setup

input_select:
  pc_modes:
    options:
      - none
    name: PC Video Modes
    initial: none

which gives me this in lovelace
image

I am using Python on an separate (from HASS.IO) computer to send a POST request to home assistant.

{'User-Agent': 'python-requests/2.20.1', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'content-type': 'application/json', 'Accept-Charset': 'UTF-8', 'Authorization': 'Bearer REDACTED', 'Content-Length': '70'}
b'{"state": "2k.xml", "attributes": {"options": ["2k.xml", "4k.xml"]}}'

Home assistant accepts the request and returns a status 200

Everything looks good with the input_select on lovelace - it shows the options and current state correctly. Using the states inspector, again everything looks good.
image

But when I try to use the input_select in lovelace to change to one of the different options, I get the error,
Invalid option: 4k.xml (possible options: none)

It seems like the input_select will only accept the original “none” option, even though “none” is no longer an option for the entity.

Hoping someone can see something I’ve missed,
Thanks!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95925

Trending Articles