def dpt_to_int(dpt: str) ->int:
    """Convert a dpt to an int"""
    if type(dpt) is int:
        return int(dpt)
    if dpt[0] == 'Z':
        return 0
    if dpt[1].upper() == 'A' or dpt[1].upper() == 'B':
        return 20
    else:
        return int(dpt)
