example.py 364 B

12345678
  1. @service
  2. def hello_world(action=None, id=None):
  3. """hello_world example using pyscript."""
  4. log.info(f"XXXXX THOMAS hello world: got action {action} id {id}")
  5. if action == "turn_on" and id is not None:
  6. light.turn_on(entity_id=id, brightness=255)
  7. elif action == "fire" and id is not None:
  8. event.fire(id, param1=12, pararm2=80)