Skip to content

Commit

Permalink
Remove test workaround from snooz (#127465)
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery authored Oct 3, 2024
1 parent f837369 commit a2c85a0
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions tests/components/snooz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
from unittest.mock import patch

from pysnooz.commands import SnoozCommandData
from pysnooz.device import DisconnectionReason
from pysnooz.testing import MockSnoozDevice as ParentMockSnoozDevice
from pysnooz.testing import MockSnoozDevice

from homeassistant.components.snooz.const import DOMAIN
from homeassistant.const import CONF_ADDRESS, CONF_TOKEN
Expand Down Expand Up @@ -67,18 +66,6 @@ class SnoozFixture:
device: MockSnoozDevice


class MockSnoozDevice(ParentMockSnoozDevice):
"""Used for testing integration with Bleak.
Adjusted for https://github.com/AustinBrunkhorst/pysnooz/issues/6
"""

def _on_device_disconnected(self, e) -> None:
if self._is_manually_disconnecting:
e.kwargs.set("reason", DisconnectionReason.USER)
return super()._on_device_disconnected(e)


async def create_mock_snooz(
connected: bool = True,
initial_state: SnoozCommandData = SnoozCommandData(on=False, volume=0),
Expand Down

0 comments on commit a2c85a0

Please sign in to comment.