From ce337da5ccfbc9f469e715c81ea790393a8acf31 Mon Sep 17 00:00:00 2001 From: Tamas Voros Date: Mon, 5 Apr 2021 21:26:41 +0000 Subject: [PATCH 1/3] fix scheduling bug --- custom_components/porthutv/schedules.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/custom_components/porthutv/schedules.py b/custom_components/porthutv/schedules.py index 7b45ec6..bfdc59b 100644 --- a/custom_components/porthutv/schedules.py +++ b/custom_components/porthutv/schedules.py @@ -51,9 +51,9 @@ def exctract_schedule_details(channel_information): for program in schedule: title = program["title"] start_time = program["start_time"] + start_datetime = program["start_datetime"] end_time = program["end_time"] - # start_datetime = parse(program["start_datetime"]) - # end_datetime = parse(program["end_datetime"]) + end_datetime = program["end_datetime"] episode_title = program["episode_title"] or "" short_description = program["short_description"] film_url = BASE_URL + program["film_url"] if program["film_url"] else "" @@ -62,7 +62,9 @@ def exctract_schedule_details(channel_information): channel_program = {} channel_program["title"] = title channel_program["start_time"] = start_time + channel_program["start_datetime"] = start_datetime channel_program["end_time"] = end_time + channel_program["end_datetime"] = end_datetime channel_program["episode_title"] = episode_title channel_program["short_description"] = short_description channel_program["film_url"] = film_url @@ -103,8 +105,8 @@ def get_actual_show_index(schedule): """ now = datetime.now(pytz.timezone(CONF_TIME_ZONE)) for i in range(len(schedule)): - start = parse_time(schedule[i]["start_time"]) - end = parse_time(schedule[i]["end_time"]) + start = parse(schedule[i]["start_datetime"]) + end = parse(schedule[i]["end_datetime"]) if in_between(now, start, end): return i return -1 From ec8377f36a1586d45a34ef6f7865e467f0585b4d Mon Sep 17 00:00:00 2001 From: Tamas Voros Date: Mon, 5 Apr 2021 21:47:29 +0000 Subject: [PATCH 2/3] add version key to the manifest --- custom_components/porthutv/const.py | 2 +- custom_components/porthutv/manifest.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/porthutv/const.py b/custom_components/porthutv/const.py index 96fceb4..ba48c76 100644 --- a/custom_components/porthutv/const.py +++ b/custom_components/porthutv/const.py @@ -3,7 +3,7 @@ NAME = "PortHuTv" DOMAIN = "porthutv" DOMAIN_DATA = f"{DOMAIN}_data" -VERSION = "1.0.5" +VERSION = "1.0.6" ISSUE_URL = "https://github.com/vorostamas/portHuTV-homeassistant/issues" diff --git a/custom_components/porthutv/manifest.json b/custom_components/porthutv/manifest.json index 41c839c..c8df438 100644 --- a/custom_components/porthutv/manifest.json +++ b/custom_components/porthutv/manifest.json @@ -8,5 +8,6 @@ "codeowners": [ "@vorostamas" ], + "version": "1.0.6", "requirements": [] } \ No newline at end of file From 4e0de6719f635b263bf9a6d294260a54d8776737 Mon Sep 17 00:00:00 2001 From: Tamas Voros Date: Mon, 5 Apr 2021 21:48:43 +0000 Subject: [PATCH 3/3] increase update interval to 5 mins --- custom_components/porthutv/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/porthutv/__init__.py b/custom_components/porthutv/__init__.py index 5a306c8..56977c1 100644 --- a/custom_components/porthutv/__init__.py +++ b/custom_components/porthutv/__init__.py @@ -27,7 +27,7 @@ from custom_components.porthutv.schedules import get_schedules, get_attributes -SCAN_INTERVAL = timedelta(minutes=30) +SCAN_INTERVAL = timedelta(minutes=5) _LOGGER = logging.getLogger(__name__)