#!/usr/bin/env python

from pocs.utils.messaging import PanMessaging


def main(sensor=None, watch_key=None, channel=None, port=6511, format=True, **kwargs):
    sub = PanMessaging.create_subscriber(port)

    while True:
        data = None
        try:
            msg_channel, msg_data = sub.receive_message()
        except KeyError:
            continue
        else:
            if msg_channel != channel:
                continue

            try:
                data = msg_data['data'][sensor]
            except KeyError:
                continue

            if watch_key in data:
                data = data[watch_key]

        if data is not None:
            if format:
                for k, v in data.items():
                    print("{}: {:.02f}".format(k, v), end='')

                print("")
            else:
                print(data)


if __name__ == '__main__':
    import argparse

    parser = argparse.ArgumentParser(description="Follow some serial keys.")

    parser.add_argument('sensor', help="Sensor to watch")
    parser.add_argument('--channel', default='environment', help="Which channel to monitor, e.g. environment, weather")
    parser.add_argument('--watch-key', default=None, help="Key to watch, e.g. amps")
    parser.add_argument('--format', default=True, action='store_true', help="Format key/values")

    args = parser.parse_args()

    try:
        main(**vars(args))
    except KeyboardInterrupt:
        print("Stopping...")

@@ -757,16 +757,17 @@
  %7B:.02f%7D
+ 
 %22.format

Add space