1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Nx584 maint (#5149)

* Update nx584 requirement to 0.4

There have been a few bug fixes to nx584 since 0.2, so this just updates
our requirement to pull in the newer version.

* Fix nx584 if no partitions are found

If we succeed in our connection to the panel but find no
configured partitions, then we will fall through to the bypass
probe and fail because 'zones' is never initialized. This fixes
both exception paths and adds a test that would poke it.
This commit is contained in:
Dan Smith
2017-01-02 23:19:33 -08:00
committed by Paulus Schoutsen
parent c864ea60c9
commit f71027a9c7
4 changed files with 11 additions and 3 deletions

View File

@@ -106,6 +106,12 @@ class TestNX584SensorSetup(unittest.TestCase):
requests.exceptions.ConnectionError
self._test_assert_graceful_fail({})
def test_setup_no_partitions(self):
"""Test the setup with connection failure."""
nx584_client.Client.return_value.list_zones.side_effect = \
IndexError
self._test_assert_graceful_fail({})
def test_setup_version_too_old(self):
""""Test if version is too old."""
nx584_client.Client.return_value.get_version.return_value = '1.0'