用于 macOS 的命令行工具,用于管理 CometBlue、EUROprog、Cygonix 和其他兼容的 BLE 温控器。 使用 Swift 和 CoreBluetooth 框架实现。 代码与 iOS 兼容
git clone https://github.com/vaddieg/cometblue.git
cd cometblue
swift build -c release
cp .build/release/cometblue /usr/local/bin
用于 iOS (JB, ssh, ldid)
cd Sources/cometblue
./build_ios.sh
scp cometblue root@your-jailbroken-iphone:/usr/bin/cometblue
cometblue discover <options>
cometblue [ get | set | backup | restore] <device_id> <options>
Commands:
* discover Scan for compatible BLE devices to find out device_ids
* get Read value(s) from device
* set Write value(s) to device
* backup Backups device settings to specified file
* restore Restores device settings from specified file
Options:
* -t [timeout] Timeout for 'discover' command, default is 60s
* -s [threshold] Signal level threshold for 'discover', default = -80dB
* -p [pin] Pin to access the device, default = 0
* -k [key.path] Keypath of the value for reading or writing, default is root "."
* -f [human | json] Specifies human readable or json as output format for 'get' command, default is 'human'
* -o [path] Output file path for 'backup' command, default is ./backup.json
* -i [path] Input file path for 'restore' command, default is ./backup.json
$ cometblue discover -s -75
AABBCC-5555-AAAA-DDEECC signal:-60
CCBBAA-2222-AAAA-FFFFFFF signal:-65
$ cometblue get AABBCC-5555-AAAA-DDEECC -k temperatures.targetHi
22.5
$ cometblue get AABBCC-5555-AAAA-DDEECC -k temperatures -f json
{"offset" : 1, "manual" : 15, "targetLow" : 18, "targetHi" : 22.5, "current" : 18}
$ cometblue set AABBCC-5555-AAAA-DDEECC -k status.flags.childlock true
Set OK
使用 'auto' 作为设备 ID 以尝试连接最近的(信号最强的)设备
使用 'cometblue [设备 ID] get -f json' 来发现 keypath 结构
设置 'deviceDate',不带参数将设置为当前日期和时间
不支持 PIN 码更改
该工具能够备份/恢复日/假日完整日程,但(目前?)不支持编辑。
https://github.com/im-0/cometblue 被用作发现设备 API 的参考。