diff --git a/custom_components/davis_vantage/client.py b/custom_components/davis_vantage/client.py index 2618d19..6f87fff 100755 --- a/custom_components/davis_vantage/client.py +++ b/custom_components/davis_vantage/client.py @@ -50,14 +50,12 @@ def __init__( self._last_raw_data: DataParser = {} # type: ignore def get_vantagepro2fromurl(self, url: str) -> VantagePro2 | None: - vp = None try: vp = VantagePro2.from_url(url) + vp.link.close() + return vp except Exception as e: raise e - finally: - vp.link.close() - return vp async def async_get_vantagepro2fromurl(self, url: str) -> VantagePro2 | None: _LOGGER.debug('async_get_vantagepro2fromurl with url=%s', url) diff --git a/custom_components/davis_vantage/manifest.json b/custom_components/davis_vantage/manifest.json index e0a81aa..66d3914 100755 --- a/custom_components/davis_vantage/manifest.json +++ b/custom_components/davis_vantage/manifest.json @@ -4,7 +4,7 @@ "version": "1.0.0", "config_flow": true, "documentation": "https://github.com/MarcoGos/davis_vantage", - "requirements": ["PyVantagePro==0.3.2"], + "requirements": ["git+https://github.com/MarcoGos/PyVantagePro.git#PyVantagePro==0.3.3"], "ssdp": [], "zeroconf": [], "homekit": {}, diff --git a/custom_components/davis_vantage/utils.py b/custom_components/davis_vantage/utils.py index 286884e..4258d11 100755 --- a/custom_components/davis_vantage/utils.py +++ b/custom_components/davis_vantage/utils.py @@ -366,7 +366,7 @@ def get_forecast_string(wrule: int) -> str: return ForecastStrings[wrule] def get_uv(value: int) -> float: - return round(value / 10, 1) + return round(value, 1) def get_solar_rad(value: int) -> float: return value