Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.
/ switchmate Public archive

A python-based command line utility for controlling Switchmate switches

License

Notifications You must be signed in to change notification settings

brianpeiris/switchmate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

switchmate

A python-based command line utility for controlling Switchmate switches.

Installation

$ pip install -r requirements.txt

Usage

./switchmate.py scan [options]
./switchmate.py status [options]
./switchmate.py <mac_address> status [options]
./switchmate.py <mac_address> switch (on | off)
./switchmate.py <mac_address> toggle
./switchmate.py <mac_address> battery-level
./switchmate.py <mac_address> debug

$ sudo ./switchmate.py scan
Scanning...
Found Switchmates:
ee:0d:eb:e4:3f:0d
e4:ee:fc:66:48:aa
c9:5e:b2:60:37:01

$ sudo ./switchmate.py status --timeout=2
Looking for switchmate status...
ee:0d:eb:e4:3f:0d off
e4:ee:fc:66:48:aa off
c9:5e:b2:60:37:01 on

$ sudo ./switchmate.py ee:0d:eb:e4:3f:0d status
Looking for switchmate status...
ee:0d:eb:e4:3f:0d off

$ sudo ./switchmate.py ee:0d:eb:e4:3f:0d switch on
Switched!

$ sudo ./switchmate.py ee:0d:eb:e4:3f:0d toggle
Switched on!

$ sudo ./switchmate.py ee:0d:eb:e4:3f:0d battery-level
Battery level: 45%