mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 17:57:55 +00:00
Remove test workaround from snooz (#127465)
This commit is contained in:
parent
f837369ef0
commit
a2c85a0ac2
@ -6,8 +6,7 @@ from dataclasses import dataclass
|
||||
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
|
||||
@ -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),
|
||||
|
Loading…
x
Reference in New Issue
Block a user