class Floorsense::DesksWebsocket

Included Modules

Defined in:

floorsense/desks_websocket.cr

Class Method Summary

Macro Summary

Instance Method Summary

Class Method Detail

def self.driver_interface : String #

Macro Detail

macro parse(response, klass, &modify) #

[View source]

Instance Method Detail

def activate_booking(booking_id : String | Int64, controller_id : String | Int32 | Int64 | Nil = nil, key : String | Nil = nil, eui64 : String | Nil = nil, userpresent : Bool | Nil = nil) #

[View source]
def all_lockers #

[View source]
def at_location(controller_id : String | Int32 | Int64, desk_key : String) #

[View source]
def bank_list(controller_id : String | Int32 | Int64) #

[View source]
def bookings(plan_id : String, period_start : Int64 | Nil = nil, period_end : Int64 | Nil = nil) #

[View source]
def check_subscriptions #

used to poll the websocket to check for liveliness


[View source]
def clear_user_cache! #

[View source]
def confirm_booking(booking_id : String | Int64) #

[View source]
def connected #

[View source]
def controller_list(locker : Bool | Nil = nil, desks : Bool | Nil = nil) #

[View source]
def create_booking(user_id : String | Int64, plan_id : String | Int32, key : String, description : String | Nil = nil, starting : Int64 | Nil = nil, ending : Int64 | Nil = nil, time_zone : String | Nil = nil, booking_type : String = "advance") #

[View source]
def create_rfid(user_id : String, card_number : String, description : String | Nil = nil) #

[View source]
def create_user(name : String, email : String, description : String | Nil = nil, extid : String | Nil = nil, pin : String | Nil = nil, usertype : String = "user") #

[View source]
def default_headers #

[View source]
def delete_rfid(card_number : String) #

[View source]
def desk_control(desk_key : String, led_state : LedState | Nil = nil, led_colour : LedColour | Nil = nil, desk_power : DeskPower | Nil = nil, desk_height : DeskHeight | Int32 | Nil = nil, qi_mode : QiMode | Nil = nil, reboot : Bool = false, clean : Bool = false) #

[View source]
def desk_list(controller_id : String | Int32 | Int64) #

[View source]
def desk_scan(eui64 : String, key : String | Int64 | Nil = nil, cid : String | Nil = nil, uid : String | Nil = nil) #

More details on: https://apiguide.smartalock.com/#d685f36e-a513-44d9-8205-2b071922733a


[View source]
def desks(plan_id : String | Int32) #

[View source]
def event_log(codes : Array(String | Int32), event_id : Int64 | Nil = nil, after : Int64 | Nil = nil, limit : Int32 = 1) #

[View source]
def expire_token! #

[View source]
def floors #

[View source]
def get_booking(booking_id : String | Int64) #

[View source]
def get_desk_height(desk_key : String) : Int32 | Nil #
Description copied from module PlaceOS::Driver::Interface::DeskControl

return nil on unknown height


[View source]
def get_desk_power(desk_key : String) : Bool | Nil #

[View source]
def get_locker_reservation(reservation_id : String) #

[View source]
def get_rfid(card_number : String) #

[View source]
def get_setting(key : String, user_id : String | Nil = nil) #

[View source]
def get_token #

[View source]
def get_user(user_id : String) #

[View source]
def locate(key : String, controller_id : String | Int32 | Int64 | Nil = nil) #

[View source]
def locker(locker_key : String) #

[View source]
def locker_change_pin(reservation_id : String, pin : Int32) #

[View source]
def locker_control(locker_key : String, light : Bool | Nil = nil, led : LedState | Nil = nil, led_colour : String | Nil = nil, buzzer : String | Nil = nil, usb_charging : String | Nil = nil, detect : Bool | Nil = nil) #

[View source]
def locker_info(locker_key : String) #

[View source]
def locker_release(reservation_id : String) #

[View source]
def locker_reservation(locker_key : String | Nil, user_id : String, type : String | Nil = nil, duration : Int32 | Nil = nil, restype : String = "adhoc", controller_id : String | Int32 | Int64 | Nil = nil) #

[View source]
def locker_reservations(active : Bool | Nil = nil, user_id : String | Nil = nil, controller_id : String | Int32 | Int64 | Nil = nil, shared : Bool | Nil = nil) #

[View source]
def locker_share(reservation_id : String, user_id : String, duration : UInt32 | Nil = nil) #

POST res-share


[View source]
def locker_shared?(reservation_id : String) #

GET res-share


[View source]
def locker_unlock(locker_key : String, user_id : String | Nil = nil, pin : String | Nil = nil) #

[View source]
def locker_unshare(reservation_id : String, user_id : String) #

POST res-unshare


[View source]
def lockers(controller_id : String | Int32 | Int64) #

[View source]
def on_load #

[View source]
def on_update #

[View source]
def received(data, task) #

[View source]
def release_booking(booking_id : String | Int64) #

[View source]
def set_desk_height(desk_key : String, desk_height : Int32) #
Description copied from module PlaceOS::Driver::Interface::DeskControl

desk height is in mm


[View source]
def set_desk_power(desk_key : String, desk_power : Bool | Nil) #
Description copied from module PlaceOS::Driver::Interface::DeskControl

desk_power on / off / nil == auto


[View source]
def set_setting(key : String, value : JSON::Any, user_id : String | Nil = nil) #

example keys: "desk_height_sit", "desk_height_stand"


[View source]
def settings_list(group_id : Int32 | Nil = nil, user_group_id : Int32 | Nil = nil, controller_id : String | Int32 | Int64 | Nil = nil) #

[View source]
def sync_locker_list #

[View source]
def token_expired? #

[View source]
def update_booking(booking_id : String | Int64, privacy : Bool | Nil = nil) #

[View source]
def user_groups_list(in_use : Bool = true) #

[View source]
def user_list(email : String | Nil = nil, name : String | Nil = nil, description : String | Nil = nil, user_group_id : String | Int32 | Nil = nil, limit : Int32 = 500, offset : Int32 = 0) #

[View source]
def voucher(voucher_id : String, pin : String) #

[View source]
def voucher_activate(voucher_id : String, pin : String) #

[View source]
def voucher_create(template_key : String, user_name : String, user_email : String, user_id : String | Nil = nil, reservation_id : String | Nil = nil, locker_key : String | Nil = nil, controller_id : String | Int32 | Int64 | Nil = nil, notes : String | Nil = nil, validfrom : Int64 | Nil = nil, validto : Int64 | Nil = nil, duration : Int32 | Nil = nil) #

[View source]
def voucher_template(key : String, subject : String, desc : String, bodyhtml : String, body : String, createuser : Bool | Nil = nil, email : Bool | Nil = nil, unlock : Bool | Nil = nil, createunlock : Bool | Nil = nil, createres : Bool | Nil = nil, release : Bool | Nil = nil, cardswipe : Bool | Nil = nil, maxuse : Int32 | Nil = nil, duration : Int32 | Nil = nil, validperiod : Int32 | Nil = nil, restype : String | Nil = nil, activatemessage : String | Nil = nil, vouchermessage : String | Nil = nil) #

[View source]
def voucher_templates #

[View source]
def ws_get(uri : String, **options) #

[View source]
def ws_post(uri : String, body : String | Nil = nil, **options) #

[View source]