Skip to content

Commit

Permalink
Update webcam logging
Browse files Browse the repository at this point in the history
  • Loading branch information
theyosh committed Jul 27, 2024
1 parent a4875f6 commit 530bde1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion hardware/webcam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,10 @@ def update(self, relays=None):
if image is False:
# Camera is offline!!
# logger.warning('Webcam {} has errors!'.format(self.name))
logger.error(f"Webcam {self} could not be updated after {time()-start:.3f} seconds! Please check your webcam connection.")
if self.state:
self._device["state"] = False
logger.error(f"Webcam {self} has gone offline! Please check your webcam connections.")
logger.error(f"Webcam {self} has gone offline! Please check your webcam connection.")
self.__raw_image = self.__set_offline_image()
self.__tile_image()
self.__raw_image.save(self.raw_image_path, "jpeg", quality=self.__JPEG_QUALITY)
Expand Down
3 changes: 2 additions & 1 deletion terrariumEngine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,8 @@ def __load_existing_webcams(self):
def _update_webcams(self):
def __process_webcam(self, webcam, current_state, relays):
start = time.time()
self.webcams[webcam.id].update(relays)
if self.webcams[webcam.id].update(relays) == False:
return

# TODO: Move this code to the webcam itself and pass through variable 'current_state'

Expand Down

0 comments on commit 530bde1

Please sign in to comment.