From b86b41ebe5db7d73209b09aacc5d79d67433d636 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Thu, 29 Jun 2023 03:43:42 +0200 Subject: [PATCH] Fix YouTube coordinator bug (#95492) Fix coordinator bug --- homeassistant/components/youtube/coordinator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/youtube/coordinator.py b/homeassistant/components/youtube/coordinator.py index 693d2550f53..72629544895 100644 --- a/homeassistant/components/youtube/coordinator.py +++ b/homeassistant/components/youtube/coordinator.py @@ -65,7 +65,7 @@ class YouTubeDataUpdateCoordinator(DataUpdateCoordinator): channels = self.config_entry.options[CONF_CHANNELS] while received_channels < len(channels): # We're slicing the channels in chunks of 50 to avoid making the URI too long - end = min(received_channels + 50, len(channels) - 1) + end = min(received_channels + 50, len(channels)) channel_request: HttpRequest = service.channels().list( part="snippet,statistics", id=",".join(channels[received_channels:end]),