Beispiel #1
0
        public void Run()
        {
            // register event handlers
            this.LocationUpdated      += locationUpdated;
            states.ZoneStatusChanged  += zoneStatusChanged;
            states.CurrentZoneChanged += currentZoneChanged;
            mqtt.MessageReceived      += messageReceived;

            // subscriptions require completed connection
            mqtt.ConnectAsync().Wait();

            // OwnTracks topics are build like this:
            //
            //  [prefix]/[user]/[device]
            //
            // see: http://owntracks.org/booklet/guide/topics/
            mqtt.Subscribe(TopicPrefixIn + "/+/+");

            log.LogInformation("Engine started.");
        }