Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update how switches write their state #548

Merged
merged 2 commits into from
Mar 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions custom_components/wyzeapi/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,14 +343,14 @@ async def async_turn_on(self, **kwargs: Any) -> None:
await self._service.turn_on_notifications(self._device)

self._device.notify = True
self.async_schedule_update_ha_state()
self.async_write_ha_state()

async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn off the switch."""
await self._service.turn_off_notifications(self._device)

self._device.notify = False
self.async_schedule_update_ha_state()
self.async_write_ha_state()

@property
def name(self):
Expand Down Expand Up @@ -419,14 +419,14 @@ async def async_turn_on(self, **kwargs: Any) -> None:
await self._service.turn_on_motion_detection(self._device)

self._device.motion = True
self.async_schedule_update_ha_state()
self.async_write_ha_state()

async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn off the switch."""
await self._service.turn_off_motion_detection(self._device)

self._device.motion = False
self.async_schedule_update_ha_state()
self.async_write_ha_state()

@property
def name(self):
Expand Down
Loading