Skip to content

Commit

Permalink
Update camera.py removed CPU unlock
Browse files Browse the repository at this point in the history
  • Loading branch information
sca075 authored Feb 6, 2024
1 parent 323a265 commit 3c3f7da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/valetudo_vacuum_camera/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,11 @@ async def async_update(self):
"""Camera Frame Update"""
# check and update the vacuum reported state
if not self._mqtt or (self._cpu_percent is not None and self._cpu_percent > 80):
if self._cpu_percent > 100 and self._shared.vacuum_state is not "cleaning":
if self._cpu_percent > 80 or (self._shared.vacuum_state != "docked"):
self._cpu_percent = 0
self._image = await self.async_pil_to_bytes(None)
# self._image = await self.async_pil_to_bytes(None)
_LOGGER.debug("No MQTT, or CPU usage too high. Returning not updated image.")
return self._image
# return self._image
# If we have data from MQTT, we process the image
self._shared.vacuum_state = await self._mqtt.get_vacuum_status()
process_data = await self._mqtt.is_data_available(self._processing)
Expand Down

0 comments on commit 3c3f7da

Please sign in to comment.