Rename a device.

    Options:

    * **id**: Specifies a device ID. Only one device at a time.
    * **title**: Title of the device.

    CLI Example:

    .. code-block:: bash

        salt '*' hue.rename id=1 title='WC for cats'
183718
def call_rename(*args, **kwargs):
    '''
    
    '''
    dev_id = _get_devices(kwargs)
    if len(dev_id) > 1:
        raise CommandExecutionError("Only one device can be renamed at a time")

    if 'title' not in kwargs:
        raise CommandExecutionError("Title is missing")

    return _set(dev_id[0], {"name": kwargs['title']}, method="")
811990
def change_name(self, new_name):
        """"""
        if not new_name:
            name = self.hostname
        else:
            name = new_name.decode()
        self.display_name = display_names.change(
            self.display_name, name)
1245850
def rename(self, old_key, new_key):
        
        return lib.zhash_rename(self._as_parameter_, old_key, new_key)
1066599
def record_rename(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/rename' % object_id, input_params, always_retry=always_retry, **kwargs)
30423
def rename(self, old_table, new_table):
        
        try:
            command = 'RENAME TABLE {0} TO {1}'.format(wrap(old_table), wrap(new_table))
        except:
            command = 'ALTER TABLE {0} RENAME {1}'.format(wrap(old_table), wrap(new_table))
        self.execute(command)
        self._printer('Renamed {0} to {1}'.format(wrap(old_table), wrap(new_table)))
        return old_table, new_table
1148964
def rename_to_tmp_name(self):
        
        self.client.rename(
            self.id,
            '%s_%s' % (self.short_id, self.name)
        )
1309786
def change_interface_id(self, interface_id):
        
        _, second = self.nicid.split('.')
        self.update(nicid='{}.{}'.format(str(interface_id), second))
1234121
def rename(self, old_host, new_host):
        
        if new_host in self.hosts_:
            raise ValueError("Host %s: already exists." % new_host)
        for line in self.lines_:  # update lines
            if line.host == old_host:
                line.host = new_host
                if line.key.lower() == "host":
                    line.value = new_host
                    line.line = "Host %s" % new_host
        self.hosts_.remove(old_host)  # update host cache
        self.hosts_.add(new_host)
1111749
def rename_driver_script(name, rename=None):  # noqa: E501
    
    if connexion.request.is_json:
        rename = Rename.from_dict(connexion.request.get_json())  # noqa: E501

    response = errorIfUnauthorized(role='developer')
    if response:
        return response
    else:
        response = ApitaxResponse()

    driver: Driver = LoadedDrivers.getDriver(name)
    if not driver.renameDriverScript(rename.original.name, rename.new.name):
        return ErrorResponse(status=500, message='Cannot rename to an existing file.')

    return Response(status=200, body=response.getResponseBody())
1216292
def on(self, dev_id):
        
        path = 'device/on'
        payload = {'id': dev_id}
        return self.rachio.put(path, payload)
1257357
def delete(self, device_id: int):
        
        device = self._get_or_abort(device_id)
        session.delete(device)
        session.commit()
        return '', 204
483495
def rename(self, new):
        
        os.rename(self, new)
        return self._next_class(new)
453747
def update_hostname(self, prompt):
        """"""
        result = re.search(self.prompt_re, prompt)
        if result:
            hostname = result.group('hostname')
            self.log("Hostname detected: {}".format(hostname))
        else:
            hostname = self.device.hostname
            self.log("Hostname not set: {}".format(prompt))
        return hostname
400534
function renameKey (name, opts) {
  if (opts && opts.renameKey) {
    return opts.renameKey(name, opts)
  }
  return name
}
571181
void setDeviceId(int nDeviceId) {
        synchronized (LOCK) {
            // Move this instance inside the HashMaps
            INSTANCES.get(connection()).remove(getDeviceId());
            INSTANCES.get(connection()).put(nDeviceId, this);

            this.deviceId = nDeviceId;
        }
    }
215553
def update_device_info(self, device_id, display_name):
        
        content = {
            "display_name": display_name
        }
        return self._send("PUT", "/devices/%s" % device_id, content=content)
235100
def put(self, device_id: int) -> Device:
        
        device = self._get_or_abort(device_id)
        self.update(device)
        session.commit()
        session.add(device)
        return device