From 0d4780e91b0bb92c255983e19b144f3352aa4b1c Mon Sep 17 00:00:00 2001 From: Chris Talkington Date: Thu, 12 Dec 2024 01:00:24 -0600 Subject: [PATCH] Set parallel updates for roku (#132892) * Set parallel updates for roku * Update sensor.py * Update media_player.py * Update remote.py * Update select.py * Update media_player.py * Update remote.py * Update select.py * Update remote.py * Update media_player.py --- homeassistant/components/roku/binary_sensor.py | 3 +++ homeassistant/components/roku/media_player.py | 3 ++- homeassistant/components/roku/remote.py | 2 ++ homeassistant/components/roku/select.py | 2 ++ homeassistant/components/roku/sensor.py | 3 +++ 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/roku/binary_sensor.py b/homeassistant/components/roku/binary_sensor.py index cd51c30c250..2e7fd12788c 100644 --- a/homeassistant/components/roku/binary_sensor.py +++ b/homeassistant/components/roku/binary_sensor.py @@ -18,6 +18,9 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback from . import RokuConfigEntry from .entity import RokuEntity +# Coordinator is used to centralize the data updates +PARALLEL_UPDATES = 0 + @dataclass(frozen=True, kw_only=True) class RokuBinarySensorEntityDescription(BinarySensorEntityDescription): diff --git a/homeassistant/components/roku/media_player.py b/homeassistant/components/roku/media_player.py index d43d62c9438..0c1f92521af 100644 --- a/homeassistant/components/roku/media_player.py +++ b/homeassistant/components/roku/media_player.py @@ -46,7 +46,6 @@ from .helpers import format_channel_name, roku_exception_handler _LOGGER = logging.getLogger(__name__) - STREAM_FORMAT_TO_MEDIA_TYPE = { "dash": MediaType.VIDEO, "hls": MediaType.VIDEO, @@ -80,6 +79,8 @@ ATTRS_TO_PLAY_ON_ROKU_AUDIO_PARAMS = { SEARCH_SCHEMA: VolDictType = {vol.Required(ATTR_KEYWORD): str} +PARALLEL_UPDATES = 1 + async def async_setup_entry( hass: HomeAssistant, entry: RokuConfigEntry, async_add_entities: AddEntitiesCallback diff --git a/homeassistant/components/roku/remote.py b/homeassistant/components/roku/remote.py index 9a31f9fd7a0..f7916fb23a2 100644 --- a/homeassistant/components/roku/remote.py +++ b/homeassistant/components/roku/remote.py @@ -13,6 +13,8 @@ from . import RokuConfigEntry from .entity import RokuEntity from .helpers import roku_exception_handler +PARALLEL_UPDATES = 1 + async def async_setup_entry( hass: HomeAssistant, diff --git a/homeassistant/components/roku/select.py b/homeassistant/components/roku/select.py index 6977f8c0d24..360d4e25415 100644 --- a/homeassistant/components/roku/select.py +++ b/homeassistant/components/roku/select.py @@ -16,6 +16,8 @@ from . import RokuConfigEntry from .entity import RokuEntity from .helpers import format_channel_name, roku_exception_handler +PARALLEL_UPDATES = 1 + def _get_application_name(device: RokuDevice) -> str | None: if device.app is None or device.app.name is None: diff --git a/homeassistant/components/roku/sensor.py b/homeassistant/components/roku/sensor.py index 56a84ead402..870386945a6 100644 --- a/homeassistant/components/roku/sensor.py +++ b/homeassistant/components/roku/sensor.py @@ -15,6 +15,9 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback from . import RokuConfigEntry from .entity import RokuEntity +# Coordinator is used to centralize the data updates +PARALLEL_UPDATES = 0 + @dataclass(frozen=True, kw_only=True) class RokuSensorEntityDescription(SensorEntityDescription):