Conversion to Swift3

This commit is contained in:
Charles Magahern
2017-05-13 00:40:03 -07:00
parent 687b45c73a
commit 091af0844a
16 changed files with 353 additions and 325 deletions
+10 -10
View File
@@ -12,20 +12,20 @@ class WemoDevice: Hashable
{
enum State
{
case Off
case On
case off
case on
}
enum Type
enum DeviceType
{
case Switch
case `switch`
}
var name: String = ""
var host: String = ""
var model: String = ""
var state: State = .Off
var type: Type = .Switch
var state: State = .off
var type: DeviceType = .switch
var serial: String = ""
init()
@@ -46,13 +46,13 @@ class WemoDevice: Hashable
}
if let state = dict["state"] as? NSNumber {
switch (state.integerValue) {
switch (state.intValue) {
case 0:
self.state = .Off
self.state = .off
case 1:
self.state = .On
self.state = .on
default:
self.state = .Off
self.state = .off
}
}