       .filter { message in
         return message.topic == topic
       }
-      .debug()
   }
   
 }
    let mqttTransport: MQTTCFSocketTransport
    let mqttSession: MQTTSession
    var delegate: MqttHomeDelegate? = nil

    mqttTransport = MQTTCFSocketTransport()
    mqttTransport.host = host


  func publish(message: Message) -> Promise<Message, HomeClientError> {
    let publish = PromiseSource<Message, HomeClientError>()
    mqttSession.publishData(message.payload, onTopic: message.topic, retain: message.retain, qos: message.mqttQos) { [weak self] error in
      if error != nil {
        publish.reject(HomeClientError(message: error.description))
      } else {
        print("published message '\(message.payloadString)' on topic '\(message.topic)'")
        self?.currentObserver?.on(.Next(message))
        publish.resolve(message)
      }
    }
