Skip to content

Commit

Permalink
Fixed issue with temps below 0°F
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGos committed Oct 31, 2023
1 parent 8020e8d commit 5adc02f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions custom_components/davis_vantage/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/davis_vantage/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down
2 changes: 1 addition & 1 deletion custom_components/davis_vantage/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5adc02f

Please sign in to comment.