Skip to content

Agroqirax/timberborn-http

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Timberborn HTTP API Wrapper

A Python library for interacting with the Timberborn HTTP automation API. Supports both direct API control and webhook-based event handling.

Features

  • Get the state of levers and adapters from Timberborn
  • Change lever states
  • Receive webhook events and trigger actions

Installation

pip install timberborn-http

Quickstart

Direct API Control

from timberborn_http import TimberbornAPI

api = TimberbornAPI("http://localhost:8080")

# Get all levers
for lever in api.get_levers():
    print(f"Lever {lever.name}is currently {lever.state}")

# Control a lever
api.switch_on("HTTP Lever 1")
api.set_color("HTTP Lever 1", "ff0000")

Webhook Events

import time
from timberborn_http import TimberbornWebhookServer

server = TimberbornWebhookServer(port=8081)

@server.on_event("HTTP Lever 1")
def handle_on(name):
    print(f"{name} turned ON!")

while True:
    time.sleep(1)

More examples & details in the examples folder

Getting Help

About

A Python library for interacting with the Timberborn HTTP automation API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages