Skip to content

Commit 1bde4f7

Browse files
committed
chore(place/logic_example): add webhook handler
1 parent f9ec06d commit 1bde4f7

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/place/logic_example.cr

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@ class Place::LogicExample < PlaceOS::Driver
1515
main_lcd[:power]
1616
end
1717

18-
def power(state : Bool = true)
18+
def power(state : Bool)
1919
system.all(:Display).power(state)
2020
end
2121

22+
def webhook(method : String, headers : Hash(String, Array(String)), body : String)
23+
logger.debug { "webhook executed" }
24+
power(true)
25+
{HTTP::Status::OK.to_i, {} of String => String, ""}
26+
end
27+
2228
def display_count
2329
system.count(:Display)
2430
end

0 commit comments

Comments
 (0)