flowsprenger / RxLifx-Swift

RxSwift based SDK for the LIFX Lan protocol
MIT License
10 stars 5 forks source link

Transport Not Ready #24

Open shaharwie opened 5 years ago

shaharwie commented 5 years ago

Everytime I try to setColorCommand fireAndForget I get error: TransportNotReady Any ideas why do I get this error?

Thanks!

flowsprenger commented 5 years ago

To send a command the SDK needs a connected UdpSocket, which is maintained while a LightService is started (let lightService = LightService(lightsChangeDispatcher: changeDispatcher) lightService.start()) or a subscription exists on UdpTransport (if you are maintaining your own Transport). If no open UdpSocket exists, all commands will throw an TransportNotReady exception until a socket has been opened. Another reason (apart from being disposed or not subscribed) would that the phone is not connected to a wifi network.