def time_to_knx(timeval, dow=0):
    """Converts a time and day-of-week to a KNX time object"""

    knxdata = [0, 0, 0]
    knxdata[0] = ((dow & 0x07) << 5) + timeval.hour
    knxdata[1] = timeval.minute
    knxdata[2] = timeval.second
    return knxdata