Skip to content

Commit

Permalink
Disable SSL verification for HA API in measure tool
Browse files Browse the repository at this point in the history
  • Loading branch information
bramstroker committed Nov 16, 2022
1 parent 1d5d224 commit 06817bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion utils/measure/light_controller/hass.py
Expand Up @@ -16,7 +16,7 @@ def __init__(self, api_url: str, token: str):
self._entity_id: str | None = None
self._model_id: str | None = None
try:
self.client = Client(api_url, token)
self.client = Client(api_url, token, global_request_kwargs={"verify": False})
except Exception as e:
raise LightControllerError(f"Failed to connect to HA API: {e}")

Expand Down
4 changes: 2 additions & 2 deletions utils/measure/powermeter/hass.py
Expand Up @@ -16,7 +16,7 @@ def __init__(self, api_url: str, token: str, call_update_entity: bool):
self._call_update_entity = call_update_entity
self._entity_id: str | None = None
try:
self.client = Client(api_url, token)
self.client = Client(api_url, token, global_request_kwargs={"verify": False})
except Exception as e:
raise PowerMeterError(f"Failed to connect to HA API: {e}")

Expand All @@ -29,7 +29,7 @@ def get_power(self) -> PowerMeasurementResult:
last_updated = parse(state.get("last_updated")).timestamp()
return PowerMeasurementResult(float(state.get("state")), last_updated)

def get_questions(self) -> list[dict]:
def get_questions(self) -> list[Question]:
power_sensor_list = self.get_power_sensors()

return [
Expand Down

0 comments on commit 06817bf

Please sign in to comment.