Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing #45

Merged
merged 11 commits into from
Apr 18, 2024
Merged
17 changes: 11 additions & 6 deletions custom_components/noaa_space_weather/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,23 @@ async def async_update(self):
image_bytes = await self.coordinator.api.async_get_first_frame(
self.image_data["product"]
)
self._cached_image = image_bytes
self.image_last_updated = datetime.now()
self._attr_image_last_updated = self.image_last_updated
_LOGGER.debug(f"Writing {self.name} state")
asyncio.run_coroutine_threadsafe(self.async_update(), self.hass.loop)
return image_bytes
else:
_LOGGER.debug(f"Returning still for {self.name}")
_LOGGER.debug(f"Updating animation for {self.name}")
image_bytes = await self.coordinator.api.async_load_animation(
self.image_data["product"]
)
_LOGGER.debug(f"Updated animation for {self.name}, caching image")
self._cached_image = image_bytes
self.image_last_updated = datetime.now()
self._attr_image_last_updated = self.image_last_updated
_LOGGER.debug(f"Writing {self.name} state")
return image_bytes
self._cached_image = image_bytes
self.image_last_updated = datetime.now()
self._attr_image_last_updated = self.image_last_updated
_LOGGER.debug(f"Writing {self.name} state")
return image_bytes

@callback
def _handle_coordinator_update(self):
Expand Down
2 changes: 1 addition & 1 deletion custom_components/noaa_space_weather/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/tcarwash/home-assistant_noaa-space-weather/issues",
"requirements": ["swpclib==4.3.7"],
"version": "2.1.0-beta3"
"version": "2.1.0-beta5"
}
Loading