Remote instance closes event forwarding on shutdown

This commit is contained in:
Paulus Schoutsen 2014-11-28 20:37:23 -08:00
parent cfae4c667a
commit 63f8f2ee7f
2 changed files with 5 additions and 1 deletions

View File

@ -142,6 +142,9 @@ class HomeAssistant(ha.HomeAssistant):
self.bus.fire(ha.EVENT_HOMEASSISTANT_STOP, self.bus.fire(ha.EVENT_HOMEASSISTANT_STOP,
origin=ha.EventOrigin.remote) 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 # Wait till all responses to homeassistant_stop are done
self._pool.block_till_done() self._pool.block_till_done()

View File

@ -3,6 +3,7 @@ test.remote
~~~~~~~~~~~ ~~~~~~~~~~~
Tests Home Assistant remote methods and classes. Tests Home Assistant remote methods and classes.
Uses port 8122 for master, 8123 for slave
""" """
# pylint: disable=protected-access,too-many-public-methods # pylint: disable=protected-access,too-many-public-methods
import unittest import unittest
@ -53,8 +54,8 @@ def tearDownModule(): # pylint: disable=invalid-name
""" Stops the Home Assistant server and slave. """ """ Stops the Home Assistant server and slave. """
global hass, slave global hass, slave
hass.stop()
slave.stop() slave.stop()
hass.stop()
class TestRemoteMethods(unittest.TestCase): class TestRemoteMethods(unittest.TestCase):