Skip to content

How to use service responses in pyscript? #494

Closed
@ralle12345

Description

@ralle12345

Hi

I tried to use the new service responses feature of HA2023.07 with the following pyscript code:

calendar.list_events(entity='calendar.awb_koeln', response_variable='agenda', start_date_time='2023-07-22 00:00:00', duration='24')

which leads to this error:

Exception in  line 1:
    calendar.list_events(entity='calendar.awb_koeln', response_variable='agenda', start_date_time='2023-07-22 00:00:00', duration='24')
                                                                                                                                  ^
ValueError: Service call requires responses but caller did not ask for responses

the following YAML works fine in the develpoper tools:

service: calendar.list_events
target:
  entity_id: calendar.awb_koln
data:
  start_date_time: 2023-07-22T00:00:00.000Z
  duration: 24
response_variable: agenda

Does pyscript need an update to work with the new feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions