Closed jcallaghan closed 4 years ago
Using the rest_command integrated I created the following service.
rest_command: new_github_issue_replace_battery: url: https://api.github.com/repos/jcallaghan/home-assistant-config/issues method: POST headers: Authorization: !secret github_token payload: '{"title":"{{ title }}","body":"{{ message }}","labels":["battery","task: maintenance"]}'
Don't forget to add Bearer in front of your access token in your secrets file.
Bearer
github_token: "Bearer 000000000000000"
Service name: rest_command.new_github_issue_replace_battery Service data:
rest_command.new_github_issue_replace_battery
{ "title": "Service test", "message": "Create via service call in Home Assistant" }
Originally posted by @jcallaghan in https://github.com/jcallaghan/home-assistant-config/issues/60#issuecomment-642597169
GitHub API
Rest command
Using the rest_command integrated I created the following service.
secrets.yaml
Don't forget to add
Bearer
in front of your access token in your secrets file.Automation/service
Service name:
rest_command.new_github_issue_replace_battery
Service data:Reference
Originally posted by @jcallaghan in https://github.com/jcallaghan/home-assistant-config/issues/60#issuecomment-642597169