-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
135 changed files
with
9,822 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
github "Alamofire/Alamofire" ~> 3.4.0 | ||
github "hkellaway/Gloss" ~> 0.7 | ||
github "robbiehanson/CocoaAsyncSocket" ~> 7.4.3 | ||
github "delba/Log" ~> 0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
github "Alamofire/Alamofire" "3.4.0" | ||
github "robbiehanson/CocoaAsyncSocket" "7.4.3" | ||
github "hkellaway/Gloss" "0.7.3" | ||
github "delba/Log" "v0.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016 Marcel Dittmann | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<p align="left"> | ||
<a href="https://img.shields.io/cocoapods/v/SwiftyHue.svg"><img alt="CocoaPods compatible" src="https://img.shields.io/cocoapods/v/SwiftyHue.svg"/></a> | ||
<a href="https://img.shields.io/cocoapods/p/SwiftyHue.svg"><img alt="Platform" src="https://img.shields.io/cocoapods/p/SwiftyHue.svg"/></a> | ||
</p> | ||
|
||
# SwiftyHue | ||
Philips Hue SDK written in swift | ||
|
||
Work in progress... | ||
|
||
## Installation | ||
|
||
### CocoaPods | ||
[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command: | ||
```bash | ||
$ gem install cocoapods | ||
``` | ||
|
||
To integrate SwiftyHue into your Xcode project using CocoaPods, specify it in your `Podfile`: | ||
```ruby | ||
source 'https://github.com/CocoaPods/Specs.git' | ||
platform :ios, '9.0' | ||
use_frameworks! | ||
|
||
pod 'SwiftyHue', '~> 0.1.2' | ||
``` | ||
|
||
Then, run the following command: | ||
|
||
```bash | ||
$ pod install | ||
``` | ||
|
||
## Usage | ||
|
||
Coming soon ... | ||
|
||
## Generate documentation | ||
|
||
Install jazzy: | ||
|
||
$ [sudo] gem install jazzy | ||
|
||
Run generate script: | ||
|
||
$ ./generate_doc.sh | ||
|
||
## Log | ||
We use ['Log'](https://github.com/delba/Log) for Logging. Log` is a powerful logging framework that provides built-in themes and formatters, and a nice API to define your owns. | ||
> Get the most out of `Log` by installing [`XcodeColors`](https://github.com/robbiehanson/XcodeColors) and [`KZLinkedConsole`](https://github.com/krzysztofzablocki/KZLinkedConsole) | ||
## Contributing | ||
We'd love to see your ideas for improving this repo! The best way to contribute is by submitting a pull request. We'll do our best to respond to your patch as soon as possible. You can also submit a issue if you find bugs. :octocat: | ||
|
||
Please make sure to follow our general coding style and add test coverage for new features! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// | ||
// BridgeAccessConfig.swift | ||
// Pods | ||
// | ||
// Created by Marcel Dittmann on 06.05.16. | ||
// | ||
// | ||
|
||
import Foundation | ||
import Gloss | ||
|
||
public struct BridgeAccessConfig: Encodable, Decodable { | ||
|
||
public let bridgeId: String; | ||
public let ipAddress: String; | ||
public let username: String; | ||
|
||
public init(bridgeId: String, ipAddress: String, username: String) { | ||
|
||
self.bridgeId = bridgeId; | ||
self.ipAddress = ipAddress; | ||
self.username = username; | ||
|
||
} | ||
|
||
public init?(json: JSON) { | ||
|
||
guard let bridgeId: String = "id" <~~ json, | ||
let ipAddress: String = "ipaddress" <~~ json, | ||
let username: String = "username" <~~ json | ||
|
||
else { return nil } | ||
|
||
self.bridgeId = bridgeId | ||
self.ipAddress = ipAddress | ||
self.username = username | ||
|
||
} | ||
|
||
public func toJSON() -> JSON? { | ||
|
||
var json = jsonify([ | ||
"id" ~~> self.bridgeId, | ||
"ipaddress" ~~> self.ipAddress, | ||
"username" ~~> self.username | ||
]) | ||
|
||
return json | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// | ||
// AppData.swift | ||
// Pods | ||
// | ||
// Created by Marcel Dittmann on 21.04.16. | ||
// | ||
// | ||
|
||
import Foundation | ||
import Gloss | ||
|
||
public struct AppData: Decodable, Encodable { | ||
|
||
/** | ||
App specific version of the data field. App should take versioning into account when parsing the data string. | ||
*/ | ||
public let version: Int | ||
|
||
/** | ||
App specific data. Free format string. | ||
*/ | ||
public let data: String | ||
|
||
public init(version: Int, data: String) { | ||
|
||
self.version = version | ||
self.data = data | ||
} | ||
|
||
public init?(json: JSON) { | ||
|
||
guard let version: Int = "data" <~~ json, | ||
let data: String = "version" <~~ json | ||
else {return nil} | ||
|
||
self.version = version | ||
self.data = data | ||
|
||
} | ||
|
||
public func toJSON() -> JSON? { | ||
|
||
return jsonify([ | ||
"version" ~~> self.version, | ||
"data" ~~> self.data, | ||
]) | ||
} | ||
} | ||
|
||
extension AppData: Hashable { | ||
|
||
public var hashValue: Int { | ||
|
||
return version | ||
} | ||
} | ||
public func ==(lhs: AppData, rhs: AppData) -> Bool { | ||
return lhs.version == rhs.version && lhs.data == rhs.data | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// | ||
// Backup.swift | ||
// Pods | ||
// | ||
// Created by Marcel Dittmann on 22.04.16. | ||
// | ||
// | ||
|
||
import Foundation | ||
import Gloss | ||
|
||
public enum BackupStatus: String { | ||
|
||
case idle, startmigration, fileready_disabled, prepare_restore, restoring | ||
} | ||
|
||
public enum BackupError: Int { | ||
|
||
case None, ExportFailed, ImportFailed | ||
} | ||
|
||
public struct Backup: Decodable, Encodable { | ||
|
||
public let status: BackupStatus? | ||
public let errorcode: BackupError? | ||
|
||
public init?(json: JSON) { | ||
|
||
status = "status" <~~ json | ||
errorcode = "errorcode" <~~ json | ||
|
||
} | ||
|
||
public func toJSON() -> JSON? { | ||
|
||
var json = jsonify([ | ||
"status" ~~> self.status, | ||
"errorcode" ~~> self.errorcode | ||
]) | ||
|
||
return json | ||
} | ||
} | ||
extension Backup: Hashable { | ||
|
||
public var hashValue: Int { | ||
|
||
return 1 | ||
} | ||
} | ||
public func ==(lhs: Backup, rhs: Backup) -> Bool { | ||
return lhs.status == rhs.status && lhs.errorcode == rhs.errorcode | ||
} |
Oops, something went wrong.