hass-core/tests
J. Nick Koston d009f06a55
Handle connection being closed in legacy samsungtv (#52137)
* Handle connection being closed in legacy samsungtv

- Mirror the websocket behavior

Fixes
```
2021-06-24 02:54:13 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.89_guestroom fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 401, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 609, in async_device_update
    raise exc
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/samsungtv/media_player.py", line 124, in update
    self._state = STATE_ON if self._bridge.is_on() else STATE_OFF
  File "/usr/src/homeassistant/homeassistant/components/samsungtv/bridge.py", line 113, in is_on
    return self._get_remote() is not None
  File "/usr/src/homeassistant/homeassistant/components/samsungtv/bridge.py", line 232, in _get_remote
    self._remote = Remote(self.config.copy())
  File "/usr/local/lib/python3.8/site-packages/samsungctl/remote.py", line 9, in __init__
    self.remote = RemoteLegacy(config)
  File "/usr/local/lib/python3.8/site-packages/samsungctl/remote_legacy.py", line 32, in __init__
    self._read_response(True)
  File "/usr/local/lib/python3.8/site-packages/samsungctl/remote_legacy.py", line 77, in _read_response
    raise exceptions.ConnectionClosed()
samsungctl.exceptions.ConnectionClosed
```

* add coverage

* pass instead
2021-06-25 07:31:44 +02:00
..
auth Migrate the name for the hassio user (#51771) 2021-06-14 09:01:18 -07:00
components Handle connection being closed in legacy samsungtv (#52137) 2021-06-25 07:31:44 +02:00
fixtures Add preset support to WLED (#52170) 2021-06-24 23:16:07 +02:00
hassfest Block custom integrations with missing or invalid version (#49916) 2021-05-17 15:48:41 +02:00
helpers Add timedelta option for async_call_later (#50164) 2021-06-12 13:14:35 +02:00
mock Disable strict type checks for tests (#49851) 2021-04-29 15:57:02 +02:00
resources
scripts Cleanup unused loggers (#46510) 2021-02-14 13:46:58 +01:00
test_util Detach aiohttp.ClientSession created by config entry setup on unload (#48908) 2021-04-09 10:14:33 -07:00
testing_config Move version validation to resolver (#51311) 2021-05-31 15:32:03 -07:00
util Use whoami for location lookup (#50934) 2021-05-22 20:34:48 -07:00
__init__.py
bandit.yaml Enable more Bandit tests (#44307) 2020-12-19 12:35:13 +01:00
common.py Merge system options into pref properties (#51347) 2021-06-01 22:34:31 +02:00
conftest.py Compile statistics for energy sensors (#50829) 2021-05-20 13:05:15 +02:00
ignore_uncaught_exceptions.py Don't try and store exceptions when the key is missing (#41803) 2020-10-16 10:01:58 +02:00
test_bootstrap.py Avoid sending empty integration list multiple times during subscribe_bootstrap_integrations (#49181) 2021-04-15 23:16:17 -07:00
test_config.py Remove stale debug statements from tests (#51059) 2021-05-25 11:52:20 +02:00
test_config_entries.py Spelling fixes (#51642) 2021-06-11 13:35:03 +02:00
test_core.py Define sync hass.create_task function (#50788) 2021-05-17 14:54:06 -05:00
test_data_entry_flow.py Use flow result type constants more (#51122) 2021-05-29 14:09:13 +02:00
test_exceptions.py Remove stale debug statements from tests (#51059) 2021-05-25 11:52:20 +02:00
test_loader.py Move version validation to resolver (#51311) 2021-05-31 15:32:03 -07:00
test_main.py Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
test_requirements.py Add network and callback support to SSDP (#51019) 2021-05-28 21:18:59 -05:00
test_runner.py Ensure shutdown does not deadlock (#49282) 2021-04-18 08:55:51 -10:00
test_setup.py Replace http startup logic with async_when_setup_or_start (#48784) 2021-04-13 14:10:58 -07:00