Skip to main content

Controls a standing desk using BLE

Project description

Blesk

Tests Code Quality

A Python command-line tool for controlling Desky standing desks via Bluetooth Low Energy (BLE). Blesk provides a simple interface to adjust desk height, save and recall presets, and manage multiple desk configurations.

Features

  • Height Control: Move your desk to any specific height in millimeters
  • Preset Management: Save and recall up to 4 preset heights
  • Multi-desk Support: Configure and manage multiple desks using profiles
  • Auto-discovery: Automatically detect nearby Desky desks
  • Cross-platform: Works on any platform with BLE support (Linux, macOS, Windows)
  • Async Architecture: Built on modern async Python for efficient operation

Requirements

  • Python 3.13 or later
  • Bluetooth Low Energy (BLE) adapter
  • Desky standing desk with Bluetooth support

Installation

Using pipx (Recommended)

pipx install blesk

Using pip

pip install blesk

From Source

git clone https://github.com/danhall/blesk.git
cd blesk
poetry install
poetry run blesk --help

Quick Start

  1. Discover available desks:

    blesk list desks
    
  2. Configure your desk:

    blesk set desk <ADDRESS>
    

    Replace <ADDRESS> with your desk's Bluetooth address from the discovery output.

  3. Move to a specific height:

    blesk go height 1000
    

    This moves the desk to 1000mm (100cm).

  4. Check current height:

    blesk get current
    

Usage

Basic Commands

List Available Desks

blesk list desks

Scans for nearby Desky desks and displays their Bluetooth addresses and names.

Configure a Desk

blesk set desk <ADDRESS>

Sets the default desk to use for commands. The address is saved in your config file.

Move to Height

blesk go height <MILLIMETERS>

Moves the desk to the specified height in millimeters.

Example:

blesk go height 750   # Sitting height (75cm)
blesk go height 1150  # Standing height (115cm)

Use Presets

blesk go preset <1-4>

Moves the desk to one of the saved presets (1-4).

Get Current Height

blesk get current

Displays the current desk height in millimeters.

Get Preset Heights

blesk get preset all        # Get all preset heights
blesk get preset <1-4>      # Get a specific preset

Advanced Options

Profiles

Manage multiple desks using different profiles:

blesk --profile home go height 1000
blesk --profile office go height 1000

Custom Config File

Specify a custom configuration file:

blesk --config /path/to/config.ini set desk <ADDRESS>

Debug Output

Enable debug or verbose logging:

blesk --debug get current
blesk --verbose go height 1000

Configuration

Configuration is stored in a platform-specific directory:

  • Linux: ~/.config/blesk/config.ini
  • macOS: ~/Library/Application Support/blesk/config.ini
  • Windows: %LOCALAPPDATA%\blesk\config.ini

Example config file:

[default]
address = AA:BB:CC:DD:EE:FF

[home]
address = 11:22:33:44:55:66

[office]
address = 77:88:99:AA:BB:CC

Development

Setup

Clone the repository and install dependencies:

git clone https://github.com/danhall/blesk.git
cd blesk
poetry install

Running Tests

poetry run pytest

With coverage:

poetry run pytest --cov=blesk

Code Quality

This project uses Ruff for linting and formatting:

poetry run ruff check .
poetry run ruff format .

Releasing

gh release create v0.1.0 --title "v0.1.0" --notes "Initial release" --latest

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

See the LICENSE file for details.

Troubleshooting

Desk Not Found

  • Ensure your desk is powered on and Bluetooth is enabled
  • Check that your Bluetooth adapter is working
  • Try increasing the scan timeout by running discovery multiple times

Acknowledgments

Built with:

  • Bleak - Cross-platform BLE library
  • Click - Command-line interface framework
  • Poetry - Dependency management

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blesk-0.2.2.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blesk-0.2.2-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file blesk-0.2.2.tar.gz.

File metadata

  • Download URL: blesk-0.2.2.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for blesk-0.2.2.tar.gz
Algorithm Hash digest
SHA256 9e6bf7d7f87aa0cb111683d0e298a3ccadb7a62c63328683ec760c4aacad066d
MD5 295298a550758a9285505bc708a4e677
BLAKE2b-256 27a8a330e9c01689f81adecb8e32403cdaad069937666293cbcc3249b7750965

See more details on using hashes here.

Provenance

The following attestation bundles were made for blesk-0.2.2.tar.gz:

Publisher: publish.yml on smarthall/blesk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file blesk-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: blesk-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for blesk-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1f1fa185797a7891fd4e537e94a905afbc18f4bf5869fde847e6bee1ac780b47
MD5 81b9c4f18044ae44c0c19b94998cfa62
BLAKE2b-256 8b474c0bfe3b3884682d2b904995e984b067b09dbf24cbba5753096eb18d1eef

See more details on using hashes here.

Provenance

The following attestation bundles were made for blesk-0.2.2-py3-none-any.whl:

Publisher: publish.yml on smarthall/blesk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page