def _check_checksum(msg):
    """Ensure checksum in message is good."""
    checksum = int(msg[-2:], 16)
    for char in msg[:-2]:
        checksum += ord(char)
    if checksum % 256 != 0:
        raise ValueError('Elk message checksum invalid')
