Skip to content

Commit

Permalink
HACS update to StarX #16
Browse files Browse the repository at this point in the history
  • Loading branch information
BeardedTinker committed Jul 9, 2022
1 parent ff5eb01 commit b6a9c76
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
11 changes: 9 additions & 2 deletions custom_components/reolink_dev/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import datetime as dt
from typing import Optional
import ssl

from urllib.parse import quote_plus
from dateutil.relativedelta import relativedelta
Expand All @@ -19,7 +20,7 @@
from homeassistant.core import Context, HomeAssistant
from homeassistant.helpers.network import get_url, NoURLAvailableError
from homeassistant.helpers.storage import STORAGE_DIR
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.aiohttp_client import async_create_clientsession
import homeassistant.util.dt as dt_util

from reolink.camera_api import Api
Expand Down Expand Up @@ -548,5 +549,11 @@ def callback_get_iohttp_session():
global last_known_hass
if last_known_hass is None:
raise Exception("No Home Assistant instance found")
session = async_get_clientsession(last_known_hass, verify_ssl=False)

context = ssl.create_default_context()
context.set_ciphers("DEFAULT")
context.check_hostname = False
context.verify_mode = ssl.CERT_NONE
session = async_create_clientsession(last_known_hass, verify_ssl=False)
session.connector._ssl = context
return session
2 changes: 1 addition & 1 deletion custom_components/reolink_dev/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Reolink IP camera",
"documentation": "https://github.com/fwestenberg/reolink_dev",
"issue_tracker": "https://github.com/fwestenberg/reolink_dev/issues",
"version": "0.54",
"version": "0.55",
"iot_class": "local_polling",
"requirements": [
"reolink==0.0.61"
Expand Down
5 changes: 4 additions & 1 deletion custom_components/spacex/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,10 @@ def state(self):
self._state = latest_launch_data["rocket"]["name"]

elif self._kind == "spacex_latest_launch_payload":
self._state = latest_launch_data["payloads_detail"][0]["name"]
if latest_launch_data["payloads_detail"]:
self._state = latest_launch_data["payloads_detail"][0]["name"]
else:
self._state = ""

elif self._kind == "spacex_starman_speed":
self._state = int(starman_data["speed_kph"])
Expand Down

0 comments on commit b6a9c76

Please sign in to comment.