vfuc / avea-cli Goto Github PK
View Code? Open in Web Editor NEWA Swift Command Line Interface to interact with Elgato Avea light bulbs.
License: MIT License
A Swift Command Line Interface to interact with Elgato Avea light bulbs.
License: MIT License
We are working now on the multi-lamp version of the marmelatze lib, you are welcome if you can make any suggestion or any test with the samples.
https://github.com/Alblahm/avea_node/wiki/Basic-Installation
Hi Jonas,
your work is very appreciating! Thank you!
But I ran into several errors (actual OSX) with built.sh:
Apple Swift version 3.0 (swiftlang-800.0.46.2 clang-800.0.38)
Target: x86_64-apple-macosx10.9
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file Avea.swift BluetoothManager.swift Color.swift main.swift -target x86_64-apple-macosx10.9 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -color-diagnostics -module-name avea -o /var/folders/nk/lr9q9gd91x34_sv6xrcmzmgw0000gn/T/Avea-74ed4f.o
BluetoothManager.swift:56:33: error: expected ',' joining parts of a multi-clause condition
if let name = peripheral.name where name.containsString("Avea"){
^~~~~
,
BluetoothManager.swift:78:38: error: expected ',' joining parts of a multi-clause condition
if let peripherals = peripherals where peripherals.count > 0 {
^~~~~
,
main.swift:252:44: error: expected ',' joining parts of a multi-clause condition
guard let red = Int(Process.arguments[2]) where (0...255).contains(red) else {
^~~~~
,
main.swift:257:47: error: expected ',' joining parts of a multi-clause condition
guard let green = Int(Process.arguments[3]) where (0...255).contains(green) else {
^~~~~
,
main.swift:262:46: error: expected ',' joining parts of a multi-clause condition
guard let blue = Int(Process.arguments[4]) where (0...255).contains(blue) else {
^~~~~
,
main.swift:267:46: error: expected ',' joining parts of a multi-clause condition
guard let white = Int(Process.arguments[5]) where (0...255).contains(white) else {
^~~~~
,
main.swift:308:51: error: expected ',' joining parts of a multi-clause condition
guard let brightness = Int(Process.arguments[2]) where (0...255).contains(brightness) else {
^~~~~
,
main.swift:347:44: error: expected ',' joining parts of a multi-clause condition
guard let red = Int(Process.arguments[3]) where (0...255).contains(red) else {
^~~~~
,
main.swift:352:47: error: expected ',' joining parts of a multi-clause condition
guard let green = Int(Process.arguments[4]) where (0...255).contains(green) else {
^~~~~
,
main.swift:357:46: error: expected ',' joining parts of a multi-clause condition
guard let blue = Int(Process.arguments[5]) where (0...255).contains(blue) else {
^~~~~
,
main.swift:362:46: error: expected ',' joining parts of a multi-clause condition
guard let white = Int(Process.arguments[6]) where (0...255).contains(white) else {
^~~~~
,
Avea.swift:15:95: error: single argument function types require parentheses
private func send(bytes: [UInt8], peripheralUUIDs : [String]? = nil, newPeripheralHandler : (String -> Void)? = nil){
^~~~~~
( )
Avea.swift:31:89: error: single argument function types require parentheses
func setColor(color: Color, peripheralUUIDs : [String]? = nil, newPeripheralHandler : (String -> Void)? = nil){
^~~~~~
( )
Avea.swift:35:97: error: single argument function types require parentheses
func setBrightness(brightness: Int, peripheralUUIDs : [String]? = nil, newPeripheralHandler : (String -> Void)? = nil){
^~~~~~
( )
Avea.swift:17:13: error: 'dispatch_semaphore_create' has been replaced by 'DispatchSemaphore.init(value:)'
let sem = dispatch_semaphore_create(0);
^~~~~~~~~~~~~~~~~~~~~~~~~
DispatchSemaphore value:
<unknown>:0: note: 'dispatch_semaphore_create' has been explicitly marked unavailable here
BluetoothManager.swift:40:24: error: single argument function types require parentheses
var newUUIDHandler : (String -> Void)?
^~~~~~
( )
BluetoothManager.swift:42:54: error: single argument function types require parentheses
func sendBytes(bytes: [UInt8], completionHandler : (Void -> Void)? = nil){
^~~~
( )
Avea.swift:23:29: error: missing argument label 'bytes:' in call
bluetoothManager.sendBytes(bytes, completionHandler: {
^
bytes:
Avea.swift:27:32: error: cannot convert value of type 'Int' to expected argument type 'dispatch_time_t' (aka 'UInt64')
dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER)
^~~~~~~~~~~~~~~~~~~~~
dispatch_time_t( )
Avea.swift:32:8: error: use of unresolved identifier 'getBytesForColor'
send(getBytesForColor(color), peripheralUUIDs: peripheralUUIDs, newPeripheralHandler: newPeripheralHandler)
^~~~~~~~~~~~~~~~
Avea.swift:36:8: error: use of unresolved identifier 'getBytesForBrightness'
send(getBytesForBrightness(brightness), peripheralUUIDs: peripheralUUIDs, newPeripheralHandler: newPeripheralHandler)
^~~~~~~~~~~~~~~~~~~~~
Avea.swift:52:26: error: missing argument label 'word:' in call
bytes.append(splitWord(extended).1)
^
word:
Avea.swift:53:26: error: missing argument label 'word:' in call
bytes.append(splitWord(extended).0)
^
word:
Avea.swift:63:31: error: missing argument label 'prefix:' in call
return colorEncodeWithPrefix(8, color: color)
^
prefix:
Avea.swift:67:31: error: missing argument label 'prefix:' in call
return colorEncodeWithPrefix(3, color: color)
^
prefix:
Avea.swift:71:31: error: missing argument label 'prefix:' in call
return colorEncodeWithPrefix(2, color: color)
^
prefix:
Avea.swift:75:31: error: missing argument label 'prefix:' in call
return colorEncodeWithPrefix(1, color: color)
^
prefix:
Avea.swift:104:26: error: missing argument label 'word:' in call
bytes.append(splitWord(encodeWhite(color.white)).0)
^
word:
Avea.swift:105:26: error: missing argument label 'word:' in call
bytes.append(splitWord(encodeWhite(color.white)).1)
^
word:
Avea.swift:106:26: error: missing argument label 'word:' in call
bytes.append(splitWord(encodeRed(color.red)).0)
^
word:
Avea.swift:107:26: error: missing argument label 'word:' in call
bytes.append(splitWord(encodeRed(color.red)).1)
^
word:
Avea.swift:108:26: error: missing argument label 'word:' in call
bytes.append(splitWord(encodeGreen(color.green)).0)
^
word:
Avea.swift:109:26: error: missing argument label 'word:' in call
bytes.append(splitWord(encodeGreen(color.green)).1)
^
word:
Avea.swift:110:26: error: missing argument label 'word:' in call
bytes.append(splitWord(encodeBlue(color.blue)).0)
^
word:
Avea.swift:111:26: error: missing argument label 'word:' in call
bytes.append(splitWord(encodeBlue(color.blue)).1)
^
word:
Can you give me a hint what goes wrong?
Stefan
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.