Add turn_on trigger to Samsung TV (#89018)
* Add turn_on trigger to Samsung TV * Add tests * Apply suggestions from code review Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Remove assert * Cleanup mock_send_magic_packet --------- Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
cd23caff58
commit
6270776fbb
10 changed files with 675 additions and 2 deletions
|
@ -20,10 +20,13 @@ from samsungtvws.exceptions import ResponseError
|
|||
from samsungtvws.remote import ChannelEmitCommand
|
||||
|
||||
from homeassistant.components.samsungtv.const import WEBSOCKET_SSL_PORT
|
||||
from homeassistant.core import HomeAssistant, ServiceCall
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
from .const import SAMPLE_DEVICE_INFO_UE48JU6400, SAMPLE_DEVICE_INFO_WIFI
|
||||
|
||||
from tests.common import async_mock_service
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
|
||||
|
@ -307,3 +310,9 @@ def mac_address_fixture() -> Mock:
|
|||
"""Patch getmac.get_mac_address."""
|
||||
with patch("getmac.get_mac_address", return_value=None) as mac:
|
||||
yield mac
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def calls(hass: HomeAssistant) -> list[ServiceCall]:
|
||||
"""Track calls to a mock service."""
|
||||
return async_mock_service(hass, "test", "automation")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue