def conv_bright_lib_to_ha(brightness) -> int:
    """Convert library brightness scale 0-16 to HA scale 0-255."""
    brightness = int(brightness) * 16
    if brightness > 255:    # force big numbers into 8-bit int range
        brightness = 255
    return brightness