* Drop unused init method
* Add type hints to media_player tests
* Adjust test_init
* Adjust media_player
* Add type hints to conftest
* Use Mock in test_media_player
* Use lowercase in test_init
* Use relative import in diagnostics
* Add type hints to config_flow
* Adjust coveragerc
* Make gethostbyname autouse
* Cleanup gethostbyname and remote fixtures
* Drop unused fixtures
* Undo type hints and usefixtures on media_player
* Undo type hints and usefixtures in test_init
* Undo type hints in conftest
* Undo usefixtures in test_config_flow
* Format
Co-authored-by: epenet <epenet@users.noreply.github.com>
* Convert persistent notification tests to async
* Create/dismiss persistent notifications in exposed functions, not service calls
* Fix notify persistent_notification
* Remove setting up persistent_notification
* Drop more setups
* Empty methods
* Undeprecate sync methods because too big task
* Fix setup clearing notifications
* Fix a bunch of tests
* Fix more tests
* Uno mas
* Test persistent notification events
* Clean up stale comment
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* 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