Skip to content

Commit a3fd8fe

Browse files
authored
Rename update to async_update for consistency (#79)
1 parent 7681fb0 commit a3fd8fe

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

zha/application/platforms/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def __init__(
421421
_LOGGER,
422422
cooldown=update_group_from_member_delay,
423423
immediate=False,
424-
function=self.update,
424+
function=self.async_update,
425425
)
426426
self._group.register_group_entity(self)
427427

@@ -465,5 +465,5 @@ async def on_remove(self) -> None:
465465
self._change_listener_debouncer.async_cancel()
466466

467467
@abstractmethod
468-
def update(self, _: Any | None = None) -> None:
468+
def async_update(self, _: Any | None = None) -> None:
469469
"""Update the state of this group entity."""

zha/application/platforms/fan/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def __init__(self, group: Group):
291291
self._preset_mode = None
292292
if hasattr(self, "info_object"):
293293
delattr(self, "info_object")
294-
self.update()
294+
self.async_update()
295295

296296
@functools.cached_property
297297
def info_object(self) -> FanEntityInfo:
@@ -345,7 +345,7 @@ async def _async_set_fan_mode(self, fan_mode: int) -> None:
345345

346346
self.maybe_emit_state_changed_event()
347347

348-
def update(self, _: Any = None) -> None:
348+
def async_update(self, _: Any = None) -> None:
349349
"""Attempt to retrieve on off state from the fan."""
350350
self.debug("Updating fan group entity state")
351351
platform_entities = self._group.get_platform_entities(self.PLATFORM)

zha/application/platforms/light/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,7 @@ def __init__(self, group: Group):
11971197

11981198
if hasattr(self, "info_object"):
11991199
delattr(self, "info_object")
1200-
self.update()
1200+
self.async_update()
12011201

12021202
@functools.cached_property
12031203
def info_object(self) -> LightEntityInfo:
@@ -1246,7 +1246,7 @@ async def async_turn_off(self, **kwargs: Any) -> None:
12461246
if self._debounced_member_refresh:
12471247
await self._debounced_member_refresh.async_call()
12481248

1249-
def update(self, _: Any = None) -> None:
1249+
def async_update(self, _: Any = None) -> None:
12501250
"""Query all members and determine the light group state."""
12511251
self.debug("Updating light group entity state")
12521252
platform_entities = self._group.get_platform_entities(self.PLATFORM)

zha/application/platforms/switch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def __init__(self, group: Group):
145145
self._on_off_cluster_handler = group.zigpy_group.endpoint[OnOff.cluster_id]
146146
if hasattr(self, "info_object"):
147147
delattr(self, "info_object")
148-
self.update()
148+
self.async_update()
149149

150150
@property
151151
def is_on(self) -> bool:
@@ -168,7 +168,7 @@ async def async_turn_off(self, **kwargs: Any) -> None: # pylint: disable=unused
168168
self._state = False
169169
self.maybe_emit_state_changed_event()
170170

171-
def update(self, _: Any | None = None) -> None:
171+
def async_update(self, _: Any | None = None) -> None:
172172
"""Query all members and determine the light group state."""
173173
self.debug("Updating switch group entity state")
174174
platform_entities = self._group.get_platform_entities(self.PLATFORM)

0 commit comments

Comments
 (0)