code: def bed_occupied(self):
          
  
          # 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
docs: 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.