diff --git a/dripline/core/calibrate.py b/dripline/core/calibrate.py index f9c50ab..e39e685 100644 --- a/dripline/core/calibrate.py +++ b/dripline/core/calibrate.py @@ -49,8 +49,8 @@ def wrapper(self, *args, **kwargs): val_dict['value_cal'] = cal elif isinstance(self._calibration, dict): logger.debug('calibration is dictionary, looking up value') - if val_dict['value_raw'] in self._calibration: - val_dict['value_cal'] = self._calibration[val_dict['value_raw']] + if str(val_dict['value_raw']) in self._calibration: + val_dict['value_cal'] = self._calibration[str(val_dict['value_raw'])] else: raise ThrowReply('service_error_invalid_value', f"raw value <{repr(val_dict['value_raw'])}> not in cal dict") else: diff --git a/dripline/core/entity.py b/dripline/core/entity.py index fae6ae3..d22d69c 100644 --- a/dripline/core/entity.py +++ b/dripline/core/entity.py @@ -176,8 +176,12 @@ def log_interval(self, new_interval): raise ThrowReply('service_error_invalid_value', f"unable to interpret a new_interval of type <{type(new_interval)}>") def scheduled_log(self): - logger.debug("in a scheduled log event") - result = self.on_get() + logger.debug(f"in a scheduled log event for {self.name}") + try: + result = self.on_get() + except ThrowReply as err: + logger.warning(f'scheduled log failed with error:\n{err}') + return try: this_value = float(result[self._check_field]) is_float = True