#!/usr/bin/env python3 import __py_include from argparse import ArgumentParser from homekit.util import send_datagram, stringify, Addr if __name__ == '__main__': parser = ArgumentParser() parser.add_argument('--name', type=str, required=True, help='node name, like `diana`') parser.add_argument('--hits', type=int, required=True, help='hits count') parser.add_argument('--server', type=str, required=True, help='center server addr in host:port format') args = parser.parse_args() send_datagram(stringify([args.name, args.hits]), Addr.fromstring(args.server))