diff --git a/homeassistant/remote.py b/homeassistant/remote.py index 7b28de0fa9e..626e7779d06 100644 --- a/homeassistant/remote.py +++ b/homeassistant/remote.py @@ -142,6 +142,9 @@ class HomeAssistant(ha.HomeAssistant): self.bus.fire(ha.EVENT_HOMEASSISTANT_STOP, origin=ha.EventOrigin.remote) + # Disconnect master event forwarding + disconnect_remote_events(self.remote_api, self.local_api) + # Wait till all responses to homeassistant_stop are done self._pool.block_till_done() diff --git a/test/test_remote.py b/test/test_remote.py index 753b9319a8e..d05dda025e0 100644 --- a/test/test_remote.py +++ b/test/test_remote.py @@ -3,6 +3,7 @@ test.remote ~~~~~~~~~~~ Tests Home Assistant remote methods and classes. +Uses port 8122 for master, 8123 for slave """ # pylint: disable=protected-access,too-many-public-methods import unittest @@ -53,8 +54,8 @@ def tearDownModule(): # pylint: disable=invalid-name """ Stops the Home Assistant server and slave. """ global hass, slave - hass.stop() slave.stop() + hass.stop() class TestRemoteMethods(unittest.TestCase):