Skip to content

Commit

Permalink
Add PARALLEL_UPDATES constant to ring integration platforms (#136470)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdb9696 authored Jan 24, 2025
1 parent b018877 commit 1697e24
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions homeassistant/components/ring/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
async_check_create_deprecated,
)

# Coordinator is used to centralize the data updates
PARALLEL_UPDATES = 0


@dataclass(frozen=True, kw_only=True)
class RingBinarySensorEntityDescription(
Expand Down
4 changes: 4 additions & 0 deletions homeassistant/components/ring/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
from .coordinator import RingDataCoordinator
from .entity import RingEntity, exception_wrap

# Coordinator is used to centralize the data updates
# Actions restricted to 1 at a time
PARALLEL_UPDATES = 1

BUTTON_DESCRIPTION = ButtonEntityDescription(
key="open_door", translation_key="open_door"
)
Expand Down
4 changes: 4 additions & 0 deletions homeassistant/components/ring/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
from .coordinator import RingDataCoordinator
from .entity import RingDeviceT, RingEntity, exception_wrap

# Coordinator is used to centralize the data updates
# Actions restricted to 1 at a time
PARALLEL_UPDATES = 1

FORCE_REFRESH_INTERVAL = timedelta(minutes=3)
MOTION_DETECTION_CAPABILITY = "motion_detection"

Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/ring/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
from .coordinator import RingListenCoordinator
from .entity import RingBaseEntity, RingDeviceT

# Event entity does not perform updates or actions.
PARALLEL_UPDATES = 0


@dataclass(frozen=True, kw_only=True)
class RingEventEntityDescription(EventEntityDescription, Generic[RingDeviceT]):
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/ring/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

_LOGGER = logging.getLogger(__name__)

# Coordinator is used to centralize the data updates
# Actions restricted to 1 at a time
PARALLEL_UPDATES = 1

# It takes a few seconds for the API to correctly return an update indicating
# that the changes have been made. Once we request a change (i.e. a light
Expand Down
4 changes: 4 additions & 0 deletions homeassistant/components/ring/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
from .coordinator import RingDataCoordinator
from .entity import RingDeviceT, RingEntity, refresh_after

# Coordinator is used to centralize the data updates
# Actions restricted to 1 at a time
PARALLEL_UPDATES = 1


async def async_setup_entry(
hass: HomeAssistant,
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/ring/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
async_check_create_deprecated,
)

# Coordinator is used to centralize the data updates
PARALLEL_UPDATES = 0


async def async_setup_entry(
hass: HomeAssistant,
Expand Down
4 changes: 4 additions & 0 deletions homeassistant/components/ring/siren.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@

_LOGGER = logging.getLogger(__name__)

# Coordinator is used to centralize the data updates
# Actions restricted to 1 at a time
PARALLEL_UPDATES = 1


@dataclass(frozen=True, kw_only=True)
class RingSirenEntityDescription(
Expand Down
4 changes: 4 additions & 0 deletions homeassistant/components/ring/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

_LOGGER = logging.getLogger(__name__)

# Coordinator is used to centralize the data updates
# Actions restricted to 1 at a time
PARALLEL_UPDATES = 1

IN_HOME_CHIME_IS_PRESENT = {v for k, v in DOORBELL_EXISTING_TYPE.items() if k != 2}


Expand Down

0 comments on commit 1697e24

Please sign in to comment.