def parse_command_line_watch_list(watch_str):
    """Parse string that represents devices to watch.

    Valid examples:
        * aa:bb:cc:dd:ee:ff
            - Threshold of 1 for the given MAC address
        * aa:bb:cc:dd:ee:ff,11:22:33:44:55:66
            - This means look for any traffic from either address
        * aa:bb:cc:dd:ee:ff=1337, 11:22:33:44:55:66=1000
            - This means look for 1337 bytes for the first address, and 1000 for the second
        * my_ssid, 11:22:33:44:55:66=1000
            - This means look for 1 byte from my_ssid or 1000 for the second
        * 11:22:33:44:55:66=-30
            - This means trigger if 11:22:33:44:55:66 is seen at a power level >= -30dBm (negative value implies power)

    Returns dict in this format:
        {'aa:bb:cc:dd:ee:ff': {'threshold': 100, 'power': None},
         '11:22:33:44:55:66': {'threshold': None, 'power': -30}}
    """

    watch_list = [i.strip() for i in watch_str.split(',')]
    watch_dict = {}

    for watch_part in watch_list:
        power = None
        threshold = None

        if '=' in watch_part:
            # dev_id is a MAC, BSSID, or SSID
            dev_id, val = [i.strip() for i in watch_part.split('=')]
            try:
                val = int(val)
            except ValueError:
                # Can't parse with "dev_id=threshold" formula, so assume '=' sign was part of ssid
                dev_id = watch_part

            if val > 0:
                threshold = val
            else:
                power = val
        else:
            dev_id = watch_part

        watch_dict[dev_id] = {'threshold': threshold, 'power': power}

    return watch_dict