Skip to content

Commit

Permalink
feat(interface/desk_control): add desk control interface
Browse files Browse the repository at this point in the history
  • Loading branch information
stakach committed Jun 20, 2024
1 parent 8c9f9f1 commit ec756a9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: placeos-driver
version: 7.0.0
version: 7.1.0
crystal: ">= 1.0.0"

dependencies:
Expand Down
21 changes: 21 additions & 0 deletions src/placeos-driver/interface/desk_control.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
abstract class PlaceOS::Driver
# Common desk control interface
module Interface::DeskControl
# desk height is in mm
abstract def set_desk_height(
desk_key : String,
desk_height : Int32? = nil
)

# return nil on unknown height
abstract def get_desk_height(desk_key : String) : Int32?

# desk_power on / off / nil == auto
abstract def set_desk_power(
desk_key : String,
desk_power : Bool?
)

abstract def get_desk_power(desk_key : String) : Bool?
end
end

0 comments on commit ec756a9

Please sign in to comment.