<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def binary_state_name(self):

 """
 Search all of the capabilities of the device and return the supported binary state field.
 Default to returning powered.
 """

        return_field = "powered"
        _capabilities = self.json_state.get('capabilities')
        if _capabilities is not None:
            _fields = _capabilities.get('fields')
            if _fields is not None:
                for field in _fields:
                    if field.get('field') in SUPPORTED_BINARY_STATE_FIELDS:
                        return_field = field.get('field')
        return return_field