Button Click

So i am trying to use i button i have to turn the bedroom light on or off. Reason being as i use Alexa to control this so i do not want to use the light switch.

the error i get is

Error loading /config/configuration.yaml: mapping values are not allowed here
in “/config/configuration.yaml”, line 199, column 17

Code is below

  • alias: Turn bedroom light when button is pressed
    trigger:
    platform: event
    event_type: click
    event_data:
    entity_id: binary_sensor.switch_158d00019f83d6
    action_type: single
    action:
    • service: light.toggle
      entity_id: light.bedroom

Is your switch a xiaomi one?
If yes change
event_type: click
To
event_type: xiaomi_aqara.click

Also change action_type to click_type

Yes it is a Xiaomi button

changed as you suggested but still get

Error loading /config/configuration.yaml: mapping values are not allowed here
in “/config/configuration.yaml”, line 199, column 19

Please edit your post as per this:

what lines of the yaml file are your code on?

Was bad formatting on my part. Changed this and now all is ok

Thanks for your help