def METHOD_NAME(self, select, **kwargs):
    key = None
    did = kwargs.get('attr')
    for d in self._state_attrs.get('ir_devices', []):
        if did and did != d.get('did'):
            continue
        for k in d.get('keys', []):
            if select not in [
                k.get('display_name'),
                k.get('name'),
                self._translations.get(k.get('display_name') or k.get('name')),
            ]:
                continue
            key = k.get('id')
    if key:
        return self.send_cloud_command(did, key)
    return False