Skip to content

Commit

Permalink
make all command classes publicly accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
flowsprenger committed Jan 30, 2018
1 parent 68d45b2 commit b40e5f4
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion RxLifxApi/RxLifxApi/Command/DeviceEchoRequestCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import RxLifx
import LifxDomain
import RxSwift

class DeviceEchoRequestCommand {
public class DeviceEchoRequestCommand {
public class func create(light: Light, payload: String, ackRequired: Bool = false, responseRequired: Bool = false) -> Observable<Result<EchoResponse>> {
let message = Message.createMessageWithPayload(EchoRequest(payload: [UInt8](payload.padding(toLength: 64, withPad: "", startingAt: 0).utf8)), target: light.target, source: light.lightSource.source)
message.header.ackRequired = ackRequired
Expand Down
2 changes: 1 addition & 1 deletion RxLifxApi/RxLifxApi/Command/DeviceGetGroupCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import RxLifx
import LifxDomain
import RxSwift

class DeviceGetGroupCommand {
public class DeviceGetGroupCommand {
public class func create(light: Light, ackRequired: Bool = false, responseRequired: Bool = false) -> Observable<Result<StateGroup>> {
let message = Message.createMessageWithPayload(GetGroup(), target: light.target, source: light.lightSource.source)
message.header.ackRequired = ackRequired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import RxLifx
import LifxDomain
import RxSwift

class DeviceGetHostFirmwareCommand {
public class DeviceGetHostFirmwareCommand {
public class func create(light: Light, ackRequired: Bool = false, responseRequired: Bool = false) -> Observable<Result<StateHostFirmware>> {
let message = Message.createMessageWithPayload(GetHostFirmware(), target: light.target, source: light.lightSource.source)
message.header.ackRequired = ackRequired
Expand Down
2 changes: 1 addition & 1 deletion RxLifxApi/RxLifxApi/Command/DeviceGetHostInfoCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import RxLifx
import LifxDomain
import RxSwift

class DeviceGetHostInfoCommand {
public class DeviceGetHostInfoCommand {
public class func create(light: Light, ackRequired: Bool = false, responseRequired: Bool = false) -> Observable<Result<StateHostInfo>> {
let message = Message.createMessageWithPayload(GetHostInfo(), target: light.target, source: light.lightSource.source)
message.header.ackRequired = ackRequired
Expand Down
2 changes: 1 addition & 1 deletion RxLifxApi/RxLifxApi/Command/DeviceGetLabelCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import RxLifx
import LifxDomain
import RxSwift

class DeviceGetLabelCommand {
public class DeviceGetLabelCommand {
public class func create(light: Light, ackRequired: Bool = false, responseRequired: Bool = false) -> Observable<Result<StateLabel>> {
let message = Message.createMessageWithPayload(GetLabel(), target: light.target, source: light.lightSource.source)
message.header.ackRequired = ackRequired
Expand Down
2 changes: 1 addition & 1 deletion RxLifxApi/RxLifxApi/Command/DeviceGetLocationCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import RxLifx
import LifxDomain
import RxSwift

class DeviceGetLocationCommand {
public class DeviceGetLocationCommand {
public class func create(light: Light, ackRequired: Bool = false, responseRequired: Bool = false) -> Observable<Result<StateLocation>> {
let message = Message.createMessageWithPayload(GetLocation(), target: light.target, source: light.lightSource.source)
message.header.ackRequired = ackRequired
Expand Down
2 changes: 1 addition & 1 deletion RxLifxApi/RxLifxApi/Command/DeviceGetVersionCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import RxLifx
import LifxDomain
import RxSwift

class DeviceGetVersionCommand {
public class DeviceGetVersionCommand {
public class func create(light: Light, ackRequired: Bool = false, responseRequired: Bool = false) -> Observable<Result<StateVersion>> {
let message = Message.createMessageWithPayload(GetVersion(), target: light.target, source: light.lightSource.source)
message.header.ackRequired = ackRequired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import RxLifx
import LifxDomain
import RxSwift

class DeviceGetWifiFirmwareCommand {
public class DeviceGetWifiFirmwareCommand {
public class func create(light: Light, ackRequired: Bool = false, responseRequired: Bool = false) -> Observable<Result<StateWifiFirmware>> {
let message = Message.createMessageWithPayload(GetWifiFirmware(), target: light.target, source: light.lightSource.source)
message.header.ackRequired = ackRequired
Expand Down
2 changes: 1 addition & 1 deletion RxLifxApi/RxLifxApi/Command/DeviceSetGroupCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import RxLifx
import LifxDomain
import RxSwift

class DeviceSetGroupCommand {
public class DeviceSetGroupCommand {
public class func create(light: Light, group: [UInt8], label: String, updatedAt:Date = Date(), ackRequired: Bool = false, responseRequired: Bool = false) -> Observable<Result<StateGroup>> {
let group = LightGroup(id: group.pad(length: 16, e: 48), label: label.padding(toLength: 32, withPad: "", startingAt: 0), updatedAt: updatedAt)
let message = Message.createMessageWithPayload(SetGroup(group: group.id, label: group.label, updated_at: UInt64(group.updatedAt.timeIntervalSince1970 * 100_000_000)), target: light.target, source: light.lightSource.source)
Expand Down
2 changes: 1 addition & 1 deletion RxLifxApi/RxLifxApi/Command/DeviceSetLabelCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import RxLifx
import LifxDomain
import RxSwift

class DeviceSetLabelCommand {
public class DeviceSetLabelCommand {
public class func create(light: Light, label: String, ackRequired: Bool = false, responseRequired: Bool = false) -> Observable<Result<StateLabel>> {
let label = label.padding(toLength: 32, withPad: "", startingAt: 0)
let message = Message.createMessageWithPayload(SetLabel(label: label), target: light.target, source: light.lightSource.source)
Expand Down
2 changes: 1 addition & 1 deletion RxLifxApi/RxLifxApi/Command/DeviceSetLocationCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import RxLifx
import LifxDomain
import RxSwift

class DeviceSetLocationCommand {
public class DeviceSetLocationCommand {
public class func create(light: Light, location: [UInt8], label: String, updatedAt:Date = Date(), ackRequired: Bool = false, responseRequired: Bool = false) -> Observable<Result<StateLocation>> {
let location = LightLocation(id: location.pad(length: 16, e: 48), label: label.padding(toLength: 32, withPad: "", startingAt: 0), updatedAt: updatedAt)
let message = Message.createMessageWithPayload(SetLocation(location: location.id, label: location.label, updated_at: UInt64(location.updatedAt.timeIntervalSince1970 * 100_000_000)), target: light.target, source: light.lightSource.source)
Expand Down
2 changes: 1 addition & 1 deletion RxLifxApi/RxLifxApi/Command/LightGetInfraredCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import RxLifx
import LifxDomain
import RxSwift

class LightGetInfraredCommand {
public class LightGetInfraredCommand {

public class func create(light: Light, ackRequired: Bool = false) -> Observable<Result<StateInfrared>> {
let message = Message.createMessageWithPayload(GetInfrared(), target: light.target, source: light.lightSource.source)
Expand Down
2 changes: 1 addition & 1 deletion RxLifxApi/RxLifxApi/Command/LightGetPowerCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import RxLifx
import LifxDomain
import RxSwift

class LightGetPowerCommand {
public class LightGetPowerCommand {

public class func create(light: Light, ackRequired: Bool = false, responseRequired: Bool = false) -> Observable<Result<LightStatePower>> {
let message = Message.createMessageWithPayload(LightGetPower(), target: light.target, source: light.lightSource.source)
Expand Down
2 changes: 1 addition & 1 deletion RxLifxApi/RxLifxApi/Command/LightSetInfraredCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import RxLifx
import LifxDomain
import RxSwift

class LightSetInfraredCommand {
public class LightSetInfraredCommand {

public class func create(light: Light, brightness: UInt16, ackRequired: Bool = false, responseRequired: Bool = false) -> Observable<Result<StateInfrared>> {
let message = Message.createMessageWithPayload(SetInfrared(brightness: brightness), target: light.target, source: light.lightSource.source)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import RxLifx
import LifxDomain
import RxSwift

class MultiZoneGetColorZonesCommand {
public class MultiZoneGetColorZonesCommand {
public class func create(light: Light, startIndex: UInt8, endIndex: UInt8, ackRequired: Bool = false, responseRequired: Bool = false) -> Observable<Result<AnyObject>> {
let message = Message.createMessageWithPayload(GetColorZones(start_index: startIndex, end_index: endIndex), target: light.target, source: light.lightSource.source)
message.header.ackRequired = ackRequired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import RxLifx
import LifxDomain
import RxSwift

class MultiZoneSetColorZonesCommand {
public class MultiZoneSetColorZonesCommand {
public class func create(light: Light, startIndex: UInt8, endIndex: UInt8, color:HSBK, duration: TimeInterval, apply:ApplicationRequest, ackRequired: Bool = false, responseRequired: Bool = false) -> Observable<Result<AnyObject>> {
let message = Message.createMessageWithPayload(SetColorZones(start_index: startIndex, end_index: endIndex, color: color, duration: UInt32(duration * 1000), apply: apply), target: light.target, source: light.lightSource.source)
message.header.ackRequired = ackRequired
Expand Down

0 comments on commit b40e5f4

Please sign in to comment.