Git Product home page Git Product logo

lampify's Introduction

lampify

This is a simple CLI application you can use to control your Bluetooth Low Energy (BLE) lamp.

Features

The project offers the following functionality:

  • Turning the lamp on / off
  • Controlling lamp brightness
  • Controlling lamp temperature
  • Sending initial setup signal
  • Sending desktop notifications

Lamp compatibility

lampify was tested with the lamp Victoria Lighting Losange/PL500, hovewer a lot of chinese lamps have common control algorithm, so lampify should be compatible with all BLE lamps that can be controlled via Android applications from the list below (the list may be incomplete).

Dependencies

This is the list of packages providing the files required to compile lampify. Be aware that package names usually do vary across different linux distributions.

  • Arch Linux

    • bluez-libs
    • libnotify
    • make
    • gcc
  • Debian / Ubuntu

    • libbluetooth-dev
    • libnotify-dev
    • make
    • gcc

Compilation

The compilation process is pretty simple:

git clone https://github.com/MasterDevX/lampify.git
cd lampify
make

To install (places executable in /usr/local/bin and sets up permissions):

sudo make install

To uninstall (removes executable from /usr/local/bin):

sudo make uninstall

Usage

General syntax

The syntax of provided CLI interface can be retrieved by running lampify without arguments:

[ user@archlinux ~ ] $ lampify                                                                               
Lampify 1.0.0 by MasterDevX
Made in Ukraine

Usage:
lampify <mode> <action> [parameter]

Available modes:
q               quiet (without notifications)
v               verbose (with notifications)

Available actions:
setup           connect to the lamp
on              turn the lamp on
off             turn the lamp off
cold  <0..9>    set cold brightness
warm  <0..9>    set warm brightness
dual  <0..9>    set dual brightness

Initial setup

Before you can control your lamp, you have to perform an initial setup so the lamp will remember the unique ID of your device generated by lampify. The ID is being generated based on your machine's hostname.

To perform the initial setup:

  • Turn the lamp on using the power switch

  • Within a few seconds after powering the lamp on, send a setup signal from your device:

    lampify q setup
    
  • If you see the lamp flashing, the connection is established

Command examples

Turn the lamp on (without notification):

lampify q on

Turn the lamp off (with notification):

lampify v off

Set warm temperature and brightness to 5 (without notification):

lampify q warm 5

Set cold temperature and brightness to 2 (with notification):

lampify v cold 2

lampify's People

Contributors

masterdevx avatar alex2772 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.