def METHOD_NAME(
    session: Session,
    switch: Switch,
    name: str,
    management_ip: str,
    room: Room,
    processor: User,
) -> None:
    if switch.host.name != name:
        message = deferred_gettext("Changed switch name from '{old}' to '{new}'.")\
            .format(old=switch.host.name, new=name)
        log_room_event(message.to_json(), processor, switch.host.room)
        switch.host.name = name
    if switch.host.room != room:
        message = deferred_gettext("Moved switch '{}' from {} to {}.")\
            .format(switch.host.name, str(switch.host.room), str(room))
        log_room_event(message.to_json(), processor, switch.host.room)
        switch.host.room = room
    if switch.management_ip != IPAddress(management_ip):
        message = deferred_gettext("Changed management IP of switch '{}' from {} to {}.")\
            .format(switch.host.name, str(switch.management_ip), management_ip)
        log_room_event(message.to_json(), processor, switch.host.room)
        switch.management_ip = ipaddr.IPAddress(management_ip)
    session.add(switch)