class App::Trigger

Overview

a controller for manually activating the trigger

Defined in:

controllers/trigger.cr

Constant Summary

IO_CHIP_PATH = Path[ENV["IO_CHIP_PATH"]? || "/dev/gpiochip0"]
OPENAPI = YAML.parse(File.exists?("openapi.yml") ? File.read("openapi.yml") : "{}")

this file is built as part of the docker build

PARSER_LIST = ["application/json"]

a controller for manually activating the trigger

RELAY_TRIGGER_LINE = (ENV["RELAY_TRIGGER_LINE"]? || "26").to_i
RESPONDER_LIST = ["application/json", "application/yaml", "text/html"]

a controller for manually activating the trigger

Class Method Summary

Instance Method Summary

Instance methods inherited from class App::Base

bad_media_type(error) : AC::Error::ContentResponse bad_media_type, invalid_param(error) : AC::Error::ParameterResponse invalid_param, set_request_id set_request_id

Class Method Detail

def self.activate(hash_parts : Hash(String | Symbol, Nil | Bool | Int32 | Int64 | Float32 | Float64 | String | Symbol) | Nil = nil, **tuple_parts) #

Helper methods for performing redirect_to calls


def self.activate_for(time : Time::Span) #

[View source]
def self.base_route #

Helper for obtaining base route


def self.io_chip : GPIO::Chip #

[View source]
def self.mutex : Mutex #

[View source]
def self.trigger_relay : GPIO::Line #

[View source]

Instance Method Detail

def activate(relay_time : Int32 = 500) : Nil #

change the state of the chicken door


[View source]
def base_route(*args, **options) #

Helper for obtaining base route


def base_route(*args, **options, &) #

Helper for obtaining base route


def manual_state(state : State) : Nil #

change the state of the chicken door


[View source]
def openapi : YAML::Any #

returns the OpenAPI representation of this service


[View source]