@staticmethod
def _prep_bools(tag, typ, bits_only=True):
    """
        if tag is a bool and a bit of an integer, returns the base tag and the bit value,
        else returns the tag name and None

        """
    if typ != 'BOOL':
        return tag, None
    if not bits_only and tag.endswith(']'):
        try:
            base, idx = tag[:-1].rsplit(sep='[', maxsplit=1)
            idx = int(idx)
            base = f'{base}[{idx // 32}]'
            return base, idx
        except Exception:
            return tag, None
    else:
        try:
            base, bit = tag.rsplit('.', maxsplit=1)
            bit = int(bit)
            return base, bit
        except Exception:
            return tag, None
