Automation for BARDI Bluetooth Light Bulb 9W RGBWW. use ADB automation need to use android smartphone :D
Interaction ADB using Ngrok over network 4g
My.Video1.mp4
Name | Status |
---|---|
Change Color | β |
On / Off Device | β |
Change Brightness | β |
Connection via Wifi / USB / Ngrok | β |
Change Theme | β |
Termux / Linux / Windows Support | β |
Clone the project
git clone https://github.com/sandrocods/Bardi-Led-Automation
Go to the project directory
cd Bardi-Led-Automation
Install dependencies
pip3 install -r requirements.txt
Start the example
cd example
python3 connection.py
you can use console application to interaction with Bardi LED
python3 main.py
Output :
β You must have adb program
- Connect usb cable to your phone
- Open cmd
- Type: adb tcpip 5555
- Get your phone ip address
How to connect multiple android devices with ADB over wifi :
β You must have adb program
-
Connect usb cable to your phone
-
Open cmd
-
Type: adb tcpip 5555
-
Get your phone ip address
-
Install Ngrok and set token
-
run this command
./ngrok tcp <ip phone>:5555
# Via Wifi
connector_bardi = BardiConnector(
timeout=10.0,
connection_type="wifi",
address="192.168.0.161:5555"
)
# Via USB
connector_bardi = BardiConnector(
timeout=10.0,
connection_type="usb"
)
# Via Ngrok ( Over Network )
connector_bardi = BardiConnector(
timeout=10.0,
connection_type="ngrok",
address="6.tcp.xxxxxxx:5555"
)
Output :
{
"status": True,
"message": "Device connected"
}
print(connector_bardi.location_color)
Output :
{'green': (0.693, 0.598), 'pink': (0.144, 0.447), 'blue': (0.769, 0.396), 'lime': (0.258, 0.595), 'cyan': (0.802, 0.545)}
print(connector_bardi.brightness)
Output :
{'50': (0.529, 0.727), '100': (0.815, 0.672), '1': (0.182, 0.671), '25': (0.331, 0.715), '75': (0.655, 0.717)}
connector_bardi.get_theme_by_music()
print(connector_bardi.theme_data)
Output :
[{'theme_name': 'Music rhythm', 'theme_location': (887, 608)}, {'theme_name': 'Game', 'theme_location': (887, 608)}, {'theme_name': 'Romantic', 'theme_location': (887, 608)}]
connector_bardi.get_theme()
print(connector_bardi.theme_data)
Output :
[{'theme_name': 'Good Night', 'theme_location': (397, 448)}, {'theme_name': 'Leisure', 'theme_location': (864, 448)}, {'theme_name': 'Gorgeous', 'theme_location': (383, 725)}, {'theme_name': 'Dream', 'theme_location': (860, 725)}, {'theme_name': 'Sunflower', 'theme_location': (386, 1003)}, {'theme_name': 'Grassland', 'theme_location': (889, 1003)}]
[
'white',
'half white',
'sepia'
]