hass-core/homeassistant/components/owntracks/helper.py
Quentame eb23846cfe Move imports in owntracks component (#27780)
* Move imports in owntracks component

* Fix nacl import

* Fix nacl import 2

* Fix nacl import 3

* Add helper.supports_encryption tests

* Fix tests helper 1

* Fix tests 2

* Add not_supports_encryption + get_cipher_error tests

* Code cov

* Fix nacl_not_imported test
2019-11-18 16:47:30 +01:00

10 lines
191 B
Python

"""Helper for OwnTracks."""
try:
import nacl
except ImportError:
nacl = None
def supports_encryption() -> bool:
"""Test if we support encryption."""
return nacl is not None