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 .

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.1.0.tar.gz (11.7 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.1.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for blesk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 511332018b22b9646aad7d1f84194d6c9c303dd2b4f8ecae5e3f468265929511
MD5 7e8585ec72477c3ab0baececc0f7b0c5
BLAKE2b-256 16b97bfd3d223939a7e3f7c69240b822122fdef1dabb72db09f88bc3eda839a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for blesk-0.1.0.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: blesk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3752290dbfb39f09545aaab525377257695dac37333e250dc9156a54165ec641
MD5 2807f76aaa22af3b27535e09b293ed26
BLAKE2b-256 d0f27fe495e1201e982677ba8ae72bf966468466991001076c0532d242763e59

See more details on using hashes here.

Provenance

The following attestation bundles were made for blesk-0.1.0-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