class Floorsense::DesksWebsocket
- Floorsense::DesksWebsocket
- PlaceOS::Driver
- Reference
- Object
Included Modules
- PlaceOS::Driver::Interface::DeskControl
Defined in:
floorsense/desks_websocket.crClass Method Summary
Macro Summary
Instance Method Summary
- #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)
- #all_lockers
- #at_location(controller_id : String | Int32 | Int64, desk_key : String)
- #bank_list(controller_id : String | Int32 | Int64)
- #bookings(plan_id : String, period_start : Int64 | Nil = nil, period_end : Int64 | Nil = nil)
-
#check_subscriptions
used to poll the websocket to check for liveliness
- #clear_user_cache!
- #confirm_booking(booking_id : String | Int64)
- #connected
- #controller_list(locker : Bool | Nil = nil, desks : Bool | Nil = nil)
- #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")
- #create_rfid(user_id : String, card_number : String, description : String | Nil = nil)
- #create_user(name : String, email : String, description : String | Nil = nil, extid : String | Nil = nil, pin : String | Nil = nil, usertype : String = "user")
- #default_headers
- #delete_rfid(card_number : String)
- #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)
- #desk_list(controller_id : String | Int32 | Int64)
-
#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
- #desks(plan_id : String | Int32)
- #event_log(codes : Array(String | Int32), event_id : Int64 | Nil = nil, after : Int64 | Nil = nil, limit : Int32 = 1)
- #expire_token!
- #floors
- #get_booking(booking_id : String | Int64)
-
#get_desk_height(desk_key : String) : Int32 | Nil
return nil on unknown height
- #get_desk_power(desk_key : String) : Bool | Nil
- #get_locker_reservation(reservation_id : String)
- #get_rfid(card_number : String)
- #get_setting(key : String, user_id : String | Nil = nil)
- #get_token
- #get_user(user_id : String)
- #locate(key : String, controller_id : String | Int32 | Int64 | Nil = nil)
- #locker(locker_key : String)
- #locker_change_pin(reservation_id : String, pin : Int32)
- #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)
- #locker_info(locker_key : String)
- #locker_release(reservation_id : String)
- #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)
- #locker_reservations(active : Bool | Nil = nil, user_id : String | Nil = nil, controller_id : String | Int32 | Int64 | Nil = nil, shared : Bool | Nil = nil)
-
#locker_share(reservation_id : String, user_id : String, duration : UInt32 | Nil = nil)
POST res-share
-
#locker_shared?(reservation_id : String)
GET res-share
- #locker_unlock(locker_key : String, user_id : String | Nil = nil, pin : String | Nil = nil)
-
#locker_unshare(reservation_id : String, user_id : String)
POST res-unshare
- #lockers(controller_id : String | Int32 | Int64)
- #on_load
- #on_update
- #received(data, task)
- #release_booking(booking_id : String | Int64)
-
#set_desk_height(desk_key : String, desk_height : Int32)
desk height is in mm
-
#set_desk_power(desk_key : String, desk_power : Bool | Nil)
desk_power on / off / nil == auto
-
#set_setting(key : String, value : JSON::Any, user_id : String | Nil = nil)
example keys: "desk_height_sit", "desk_height_stand"
- #settings_list(group_id : Int32 | Nil = nil, user_group_id : Int32 | Nil = nil, controller_id : String | Int32 | Int64 | Nil = nil)
- #sync_locker_list
- #token_expired?
- #update_booking(booking_id : String | Int64, privacy : Bool | Nil = nil)
- #user_groups_list(in_use : Bool = true)
- #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)
- #voucher(voucher_id : String, pin : String)
- #voucher_activate(voucher_id : String, pin : String)
- #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)
- #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)
- #voucher_templates
- #ws_get(uri : String, **options)
- #ws_post(uri : String, body : String | Nil = nil, **options)
Class Method Detail
Macro Detail
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)
#
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")
#
def create_rfid(user_id : String, card_number : String, description : String | Nil = nil)
#
def create_user(name : String, email : String, description : String | Nil = nil, extid : String | Nil = nil, pin : String | Nil = nil, usertype : String = "user")
#
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)
#
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
def event_log(codes : Array(String | Int32), event_id : Int64 | Nil = nil, after : Int64 | Nil = nil, limit : Int32 = 1)
#
def get_desk_height(desk_key : String) : Int32 | Nil
#
Description copied from module PlaceOS::Driver::Interface::DeskControl
return nil on unknown height
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)
#
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)
#
def set_desk_height(desk_key : String, desk_height : Int32)
#
Description copied from module PlaceOS::Driver::Interface::DeskControl
desk height is in mm
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
def set_setting(key : String, value : JSON::Any, user_id : String | Nil = nil)
#
example keys: "desk_height_sit", "desk_height_stand"
def settings_list(group_id : Int32 | Nil = nil, user_group_id : Int32 | Nil = nil, controller_id : String | Int32 | Int64 | Nil = nil)
#
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)
#
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)
#
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)
#