Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Sources/Base/BridgeResourceModels/Light.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Light: BridgeResource, BridgeResourceDictGenerator {
/**
Identifier of the light.
*/
public let identifier: String
public var identifier: String = ""

/**
A unique, editable name given to the light.
Expand Down Expand Up @@ -69,7 +69,7 @@ public class Light: BridgeResource, BridgeResourceDictGenerator {

public required init?(json: JSON) {

guard let identifier: String = "id" <~~ json,
guard //let identifier: String = "id" <~~ json,
let name: String = "name" <~~ json,
let state: LightState = "state" <~~ json,
let type: String = "type" <~~ json,
Expand All @@ -80,7 +80,7 @@ public class Light: BridgeResource, BridgeResourceDictGenerator {

else { print("Can't create Light from JSON:\n \(json)"); return nil }

self.identifier = identifier
//self.identifier = identifier
self.name = name
self.state = state
self.type = type
Expand All @@ -97,7 +97,7 @@ public class Light: BridgeResource, BridgeResourceDictGenerator {
public func toJSON() -> JSON? {

let json = jsonify([
"id" ~~> identifier,
//"id" ~~> identifier,
"name" ~~> name,
"state" ~~> state,
"type" ~~> type,
Expand Down
1 change: 0 additions & 1 deletion Sources/Base/BridgeResourceModels/LightState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public struct LightState: JSONDecodable, JSONEncodable {
"colormode" ~~> colormode,
"reachable" ~~> reachable,
"transitiontime" ~~> transitiontime

])
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Base/BridgeResourcesCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public class BridgeResourcesCache: JSONDecodable {

// MARK: Set

internal func setLights(_ lights: [String: Light]) {
public func setLights(_ lights: [String: Light]) {
_lights = lights
}

Expand Down
Loading