def conv_bright_ha_to_lib(brightness) -> int:
    """Convert HA brightness scale 0-255 to library scale 0-16."""
    if brightness == 255:   # this will end up as 16 which is max
        brightness = 256
    return int(brightness / 16)