Compare commits

...

4 Commits

4 changed files with 9 additions and 10 deletions

View File

@ -24,7 +24,7 @@ from .const import (
POCASI_INVALID_KEY,
WSLINK_URL,
)
from .utils import update_options
from .utils import anonymize, update_options
_LOGGER = logging.getLogger(__name__)
@ -117,12 +117,12 @@ class PocasiPush:
_data["PASSWORD"] = _api_key
request_url = f"{POCASI_CZ_URL}{DEFAULT_URL}"
session = async_get_clientsession(self.hass, verify_ssl=False)
session = async_get_clientsession(self.hass)
_LOGGER.debug(
"Payload for Pocasi Meteo server: [mode=%s] [request_url=%s] = %s",
mode,
request_url,
_data,
anonymize(_data),
)
try:
async with session.get(request_url, params=_data) as resp:

View File

@ -37,7 +37,7 @@ class RouteInfo:
url_path: str
handler: Handler
enabled: bool = False
fallback: Handler = field(default_factory=lambda: unregistred)
fallback: Handler = field(default_factory=lambda: unregistered)
class Routes:
@ -57,7 +57,7 @@ class Routes:
info = self.routes.get(request.path)
if not info:
_LOGGER.debug("Route %s is not registered!", request.path)
return await unregistred(request)
return await unregistered(request)
handler = info.handler if info.enabled else info.fallback
return await handler(request)
@ -91,7 +91,7 @@ class Routes:
return "No routes is enabled."
async def unregistred(request: Request) -> Response:
async def unregistered(request: Request) -> Response:
"""Fallback response for unknown/disabled routes.
This should normally never happen for correctly configured stations, but it provides

View File

@ -15,7 +15,6 @@ import logging
import math
from typing import Any, cast
import numpy as np
from py_typecheck.core import checked_or
from homeassistant.components import persistent_notification
@ -317,10 +316,10 @@ def heat_index(
+ 0.00085282 * temp * rh * rh
- 0.00000199 * temp * temp * rh * rh
)
if rh < 13 and (temp in np.arange(80, 112, 0.1)):
if rh < 13 and (80 <= temp <= 112):
adjustment = ((13 - rh) / 4) * math.sqrt((17 - abs(temp - 95)) / 17)
if rh > 80 and (temp in np.arange(80, 87, 0.1)):
if rh > 80 and (80 <= temp <= 87):
adjustment = ((rh - 85) / 10) * ((87 - temp) / 5)
return round((full_index + adjustment if adjustment else full_index), 2)

View File

@ -165,7 +165,7 @@ class WindyPush:
if self.log:
_LOGGER.info("Dataset for windy: %s", purged_data)
session = async_get_clientsession(self.hass, verify_ssl=False)
session = async_get_clientsession(self.hass)
try:
async with session.get(
request_url, params=purged_data, headers=headers