def status(self):
        status_data = redis.printer_status_get(self.id)

        for k, v in status_data.items():
            status_data[k] = json.loads(v)

        return dict_or_none(status_data)
Beispiel #2
0
    def should_watch(self):
        if not self.watching or redis.user_dh_balance_get(self.user_id) < 0:
            return False

        printer_cur_state = redis.printer_status_get(self.id, 'state')
        return printer_cur_state and json.loads(printer_cur_state).get('flags', {}).get('printing', False) and \
            self.current_print and self.current_print.alert_muted_at == None
    def actively_printing(self):
        printer_cur_state = redis.printer_status_get(self.id, 'state')

        return printer_cur_state and json.loads(printer_cur_state).get(
            'flags', {}).get('printing', False)
Beispiel #4
0
 def status(self):
     status_data = redis.printer_status_get(self.id)
     if 'seconds_left' in status_data:
         status_data['seconds_left'] = int(status_data['seconds_left'])
     return dict_or_none(status_data)