def bed_occupied(self):
        """
        bed_occupied: None -> boolean

        Determines whether the bed is currently occupied by requesting
        data from the remote XBee and comparing the analog value with
        a threshold.
        """

        # Receive samples from the remote device
        self._set_send_samples(True)

        while True:
            packet = self.hw.wait_read_frame()

            if 'adc-0' in packet['samples'][0]:
                # Stop receiving samples from the remote device
                self._set_send_samples(False)
                return packet['samples'][0]['adc-0'] > XBeeAlarm.DETECT_THRESH
def bed_occupied ( self ) : self . _set_send_samples ( True ) while True : packet = self . hw . wait_read_frame ( ) if 'adc-0' in packet [ 'samples' ] [ 0 ] : self . _set_send_samples ( False ) return packet [ 'samples' ] [ 0 ] [ 'adc-0' ] > XBeeAlarm . DETECT_THRESH
bed_occupied: None -> boolean

        Determines whether the bed is currently occupied by requesting
        data from the remote XBee and comparing the analog value with
        a threshold.