Giter VIP home page Giter VIP logo

linakdeskapp's Introduction

Linak Desk Application

This is desktop application controlling Linak office desks. Application functionality is similar to application provided by Linak. One of the goals of this project is to allow the desk control under Linux operating systems, because official application does not support Linux OS.

Application was tested on DPG1C desk panel containing built-in Bluetooth module.

Communication protocol between DPG1C module and official application was reverse engineered mostly by mocking DPG1C Bluetooth service.

Features

  • scanning for nearby devices
  • moving up/down
  • moving to favourite position
  • setting reminder, desk offset and favoritie positions
  • system tray icon
  • auto reconnecting to recent device
  • persisting application settings
  • drawing position chart over time
  • position statistics

Screens

Status of desk Application settings Device settings

Modules

  • linakdeskapp.main -- entry point for the application
  • linakdeskmock -- Bluetooth service mocking Linak desk service
  • testlinakdeskapp -- unit tests for the application

Permissions

Bluepy package requires special privileges when scanning for nearby devices. It is recomended to solve it by adding capabilities to the package: cd <PYTHON_PATH>/site-packages/bluepy sudo setcap 'cap_net_raw,cap_net_admin+eip' bluepy-helper Go to directory where bluepy is installed (local user or system) and execute setcap as stated above.

Running application

To run application try one of:

  • run src/linakdeskctl
  • run src/linakdeskapp/main.py
  • execute cd src; python3 -m linakdeskapp

Application can be run in profiler mode passing --profile as command line parameter.

Running mock service

To run mock simply execute linakdeskmock/main.py file.

Running tests

To run tests execute src/runtests.py. It can be run with code profiling and code coverage options.

In addition there is demo application not requiring Bluetooth connection. It can be run by testlinakdeskapp/gui/main_window_example.py.

Required libraries

  • PyQt5
  • matplotlib
  • pandas
  • bluepy

Installation: sudo apt install python3-matplotlib python3-pandas pip3 install --user bluepy

Examples of use of not obvious Python mechanisms:

  • use of EnumMeta class (linak_service.py)
  • defining method decorators (synchronied.py)
  • use of threading: Thread, Event, Timer
  • use of QThreadPool and Worker concepts
  • properly killing (Ctrl+C) PyQt (sigint.py)
  • loading of UI files and inheriting from it
  • embedding matplotlib graph with navigation toolbar into PyQt widget
  • code profiling (cProfile)
  • code coverage (coverage)

ToDo:

  • handle cm/inch unit switch
  • add fav buttons inside popup of system tray icon
  • handle away from keyboard

Issues:

  • disabling light guidance does not seem to work. It seems to be problem on device side, because even in Linak app it does not work.

Development

If You are willing to work on this project, then after first clone You have to fetch submodule inside lib. To do this simply call configure_submodules.sh script placed in root directory tree.

Support

If You like the project or it is valuable to You then feel free to support my work.

Donate with PayPal

References:

linakdeskapp's People

Contributors

anetczuk avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.