80 lines
3.1 KiB
YAML
80 lines
3.1 KiB
YAML
# REST commands to create and update Notion pages.
|
|
notion_create_print:
|
|
url: "https://api.notion.com/v1/pages"
|
|
method: POST
|
|
content_type: "application/json"
|
|
headers:
|
|
Authorization: !secret notion_token_bearer
|
|
Notion-Version: "2022-06-28"
|
|
payload: >
|
|
{
|
|
"parent": { "database_id": "c7bab550efd740909f656f101697832d" },
|
|
"properties": {
|
|
"File Name": { "title": [{ "text": { "content": "{{ file_name }}" } }] },
|
|
"Status": { "select": { "name": "Printing" } },
|
|
"Printer": { "select": { "name": "{{ printer_name }}" } },
|
|
"Filament Type": { "select": { "name": "{{ filament_type }}" } },
|
|
"Filament Color": { "rich_text": [{ "text": { "content": "{{ filament_color }}" } }] },
|
|
"date:Started:start": { "date": { "start": "{{ started }}", "time_zone": "America/New_York" } }
|
|
}
|
|
}
|
|
|
|
notion_update_print:
|
|
url: "https://api.notion.com/v1/pages/{{ page_id }}"
|
|
method: PATCH
|
|
content_type: "application/json"
|
|
headers:
|
|
Authorization: !secret notion_token_bearer
|
|
Notion-Version: "2022-06-28"
|
|
payload: >
|
|
{
|
|
"properties": {
|
|
"Status": { "select": { "name": "{{ status }}" } },
|
|
"Weight (g)": { "number": {{ weight }} },
|
|
"Length (mm)": { "number": {{ length }} },
|
|
"date:Completed:start": { "date": { "start": "{{ completed }}", "time_zone": "America/New_York" } }
|
|
}
|
|
}
|
|
|
|
# Google Chat incoming webhook (space webhook) for OctoEverywhere printer alerts.
|
|
# Call with `payload` = a dict shaped like a Chat Message body (text and/or cardsV2).
|
|
# Used by automations/05_printers_and_workshop/05c_octoeverywhere_google_chat.yaml.
|
|
google_chat_octoeverywhere:
|
|
url: !secret google_chat_octoeverywhere_webhook
|
|
method: POST
|
|
content_type: "application/json; charset=UTF-8"
|
|
payload: "{{ payload | to_json }}"
|
|
|
|
# One Google Chat space per printer. The automation picks one by PrinterName and
|
|
# falls back to google_chat_octoeverywhere (shared space) for unknown printers.
|
|
google_chat_octoeverywhere_constipation_orion:
|
|
url: !secret google_chat_octoeverywhere_constipation_orion
|
|
method: POST
|
|
content_type: "application/json; charset=UTF-8"
|
|
payload: "{{ payload | to_json }}"
|
|
google_chat_octoeverywhere_printney_spears:
|
|
url: !secret google_chat_octoeverywhere_printney_spears
|
|
method: POST
|
|
content_type: "application/json; charset=UTF-8"
|
|
payload: "{{ payload | to_json }}"
|
|
google_chat_octoeverywhere_prints_charming:
|
|
url: !secret google_chat_octoeverywhere_prints_charming
|
|
method: POST
|
|
content_type: "application/json; charset=UTF-8"
|
|
payload: "{{ payload | to_json }}"
|
|
google_chat_octoeverywhere_polly_pocket:
|
|
url: !secret google_chat_octoeverywhere_polly_pocket
|
|
method: POST
|
|
content_type: "application/json; charset=UTF-8"
|
|
payload: "{{ payload | to_json }}"
|
|
google_chat_octoeverywhere_layer_slayer:
|
|
url: !secret google_chat_octoeverywhere_layer_slayer
|
|
method: POST
|
|
content_type: "application/json; charset=UTF-8"
|
|
payload: "{{ payload | to_json }}"
|
|
google_chat_octoeverywhere_turd_flinger:
|
|
url: !secret google_chat_octoeverywhere_turd_flinger
|
|
method: POST
|
|
content_type: "application/json; charset=UTF-8"
|
|
payload: "{{ payload | to_json }}"
|