diff --git a/README.md b/README.md index e2eeb9d..1999872 100644 --- a/README.md +++ b/README.md @@ -52,36 +52,36 @@ You can always specify which bluetooth adapter (default: hci0) you want to use b Just launch magicblueshell as root user : ``` -piouffb@Ordinatron-3000:~/workspace/python/pyMagicBlue$ sudo magicblueshell -Magic Blue interactive shell v0.1 -Type "help" to see what you can do +Magic Blue interactive shell v0.2.2 +Type "help" for a list of available commands > help ---------------------------- | List of available commands | ---------------------------- -COMMAND PARAMETERS DETAILS -------- ---------- ------- -help Show this help -list_devices List Bluetooth LE devices in range -connect mac_address Connect to light bulb -disconnect Disconnect from current light bulb -set_color name|hexvalue Change bulb's color -set_warm_light intensity[0.0-1.0] Set warm light -turn on|off Turn on / off the bulb -exit Exit the script - -> list_devices -Listing Bluetooth LE devices in range. Press CTRL+C to stop searching. -Name Mac address ----- ----------- -LEDBLE-1D433903 C7:17:1D:43:39:03 ---------------- +COMMAND PARAMETERS DETAILS +------- ---------- ------- +help Show this help +list_devices List Bluetooth LE devices in range +ls // // +connect mac_address or ID Connect to light bulb +disconnect Disconnect from current light bulb +set_color name or hexadecimal value Change bulb's color +set_warm_light intensity[0.0-1.0] Set warm light +turn on|off Turn on / off the bulb +exit Exit the script +> ls +Listing Bluetooth LE devices in range for 5 minutes.Press CTRL+C to stop searching. +ID Name Mac address +-- ---- ----------- +1 LEDBLE-1D433903 c7:17:1d:43:39:03 ^C -> connect C7:17:1D:43:39:03 -INFO:__main__:Connected : True +> connect 1 +INFO:magicblue.magicblueshell:Connected +> set_color red > exit Bye ! + ``` #### Passing command as an option @@ -90,6 +90,9 @@ Usage is defined as follow : ``` usage: magicblueshell [-h] [-l LIST_COMMANDS] [-c COMMAND] [-m MAC_ADDRESS] + [-a BLUETOOTH_ADAPTER] [-b BULB_VERSION] + +Python tool to control MagicBlue bulbs over Bluetooth optional arguments: -h, --help show this help message and exit @@ -98,14 +101,15 @@ optional arguments: -c COMMAND, --command COMMAND Command to execute -m MAC_ADDRESS, --mac_address MAC_ADDRESS - Device mac address. Must be set if command given in -c needs you to be connected + Device mac address. Must be set if command given in -c + needs you to be connected -a BLUETOOTH_ADAPTER, --bluetooth_adapter BLUETOOTH_ADAPTER - Bluetooth adapter name as listed by hciconfig command + Bluetooth adapter name as listed by hciconfig -b BULB_VERSION, --bulb-version BULB_VERSION Bulb version as displayed in the official app -``` - +``` + So if you want to change the color of bulb with mac address "C7:17:1D:43:39:03", just run : > sudo magicblueshell -c 'set_color red' -m C7:17:1D:43:39:03 diff --git a/magicblue/__init__.py b/magicblue/__init__.py index 470f592..d14018d 100644 --- a/magicblue/__init__.py +++ b/magicblue/__init__.py @@ -7,5 +7,5 @@ from magicblue.magicbluelib import MagicBlue -__version__ = "0.2.1" +__version__ = "0.2.2"