Merge pull request #1540 from balloob/slowtests_rfxtrx
Fixed close connection issue with rfxtrx device and update rfxtrx lib
This commit is contained in:
commit
dd607ea84a
6 changed files with 15 additions and 18 deletions
|
@ -58,9 +58,6 @@ omit =
|
||||||
homeassistant/components/nest.py
|
homeassistant/components/nest.py
|
||||||
homeassistant/components/*/nest.py
|
homeassistant/components/*/nest.py
|
||||||
|
|
||||||
homeassistant/components/rfxtrx.py
|
|
||||||
homeassistant/components/*/rfxtrx.py
|
|
||||||
|
|
||||||
homeassistant/components/rpi_gpio.py
|
homeassistant/components/rpi_gpio.py
|
||||||
homeassistant/components/*/rpi_gpio.py
|
homeassistant/components/*/rpi_gpio.py
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,9 @@ https://home-assistant.io/components/rfxtrx/
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.util import slugify
|
from homeassistant.util import slugify
|
||||||
|
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
|
||||||
|
|
||||||
REQUIREMENTS = ['https://github.com/Danielhiversen/pyRFXtrx/' +
|
REQUIREMENTS = ['pyRFXtrx==0.6.5']
|
||||||
'archive/0.5.zip#pyRFXtrx==0.5']
|
|
||||||
|
|
||||||
DOMAIN = "rfxtrx"
|
DOMAIN = "rfxtrx"
|
||||||
|
|
||||||
|
@ -72,6 +72,10 @@ def setup(hass, config):
|
||||||
else:
|
else:
|
||||||
RFXOBJECT = rfxtrxmod.Core(device, handle_receive, debug=debug)
|
RFXOBJECT = rfxtrxmod.Core(device, handle_receive, debug=debug)
|
||||||
|
|
||||||
|
def _shutdown_rfxtrx(event):
|
||||||
|
RFXOBJECT.close_connection()
|
||||||
|
hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, _shutdown_rfxtrx)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -66,9 +66,6 @@ hikvision==0.4
|
||||||
# homeassistant.components.sensor.dht
|
# homeassistant.components.sensor.dht
|
||||||
# http://github.com/mala-zaba/Adafruit_Python_DHT/archive/4101340de8d2457dd194bca1e8d11cbfc237e919.zip#Adafruit_DHT==1.1.0
|
# http://github.com/mala-zaba/Adafruit_Python_DHT/archive/4101340de8d2457dd194bca1e8d11cbfc237e919.zip#Adafruit_DHT==1.1.0
|
||||||
|
|
||||||
# homeassistant.components.rfxtrx
|
|
||||||
https://github.com/Danielhiversen/pyRFXtrx/archive/0.5.zip#pyRFXtrx==0.5
|
|
||||||
|
|
||||||
# homeassistant.components.sensor.netatmo
|
# homeassistant.components.sensor.netatmo
|
||||||
https://github.com/HydrelioxGitHub/netatmo-api-python/archive/43ff238a0122b0939a0dc4e8836b6782913fb6e2.zip#lnetatmo==0.4.0
|
https://github.com/HydrelioxGitHub/netatmo-api-python/archive/43ff238a0122b0939a0dc4e8836b6782913fb6e2.zip#lnetatmo==0.4.0
|
||||||
|
|
||||||
|
@ -157,6 +154,9 @@ pushetta==1.0.15
|
||||||
# homeassistant.components.sensor.cpuspeed
|
# homeassistant.components.sensor.cpuspeed
|
||||||
py-cpuinfo==0.2.3
|
py-cpuinfo==0.2.3
|
||||||
|
|
||||||
|
# homeassistant.components.rfxtrx
|
||||||
|
pyRFXtrx==0.6.5
|
||||||
|
|
||||||
# homeassistant.components.media_player.cast
|
# homeassistant.components.media_player.cast
|
||||||
pychromecast==0.7.2
|
pychromecast==0.7.2
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,9 @@ from homeassistant.components import rfxtrx as rfxtrx_core
|
||||||
from homeassistant.components.light import rfxtrx
|
from homeassistant.components.light import rfxtrx
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
from tests.common import get_test_home_assistant
|
from tests.common import get_test_home_assistant
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(True, reason='Does not clean up properly, takes 100% CPU')
|
|
||||||
class TestLightRfxtrx(unittest.TestCase):
|
class TestLightRfxtrx(unittest.TestCase):
|
||||||
"""Test the Rfxtrx light platform."""
|
"""Test the Rfxtrx light platform."""
|
||||||
|
|
||||||
|
@ -22,6 +19,8 @@ class TestLightRfxtrx(unittest.TestCase):
|
||||||
"""Stop everything that was started."""
|
"""Stop everything that was started."""
|
||||||
rfxtrx_core.RECEIVED_EVT_SUBSCRIBERS = []
|
rfxtrx_core.RECEIVED_EVT_SUBSCRIBERS = []
|
||||||
rfxtrx_core.RFX_DEVICES = {}
|
rfxtrx_core.RFX_DEVICES = {}
|
||||||
|
if rfxtrx_core.RFXOBJECT:
|
||||||
|
rfxtrx_core.RFXOBJECT.close_connection()
|
||||||
self.hass.stop()
|
self.hass.stop()
|
||||||
|
|
||||||
def test_default_config(self):
|
def test_default_config(self):
|
||||||
|
|
|
@ -5,12 +5,9 @@ from homeassistant.components import rfxtrx as rfxtrx_core
|
||||||
from homeassistant.components.switch import rfxtrx
|
from homeassistant.components.switch import rfxtrx
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
from tests.common import get_test_home_assistant
|
from tests.common import get_test_home_assistant
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(True, reason='Does not clean up properly, takes 100% CPU')
|
|
||||||
class TestSwitchRfxtrx(unittest.TestCase):
|
class TestSwitchRfxtrx(unittest.TestCase):
|
||||||
"""Test the Rfxtrx switch platform."""
|
"""Test the Rfxtrx switch platform."""
|
||||||
|
|
||||||
|
@ -22,6 +19,8 @@ class TestSwitchRfxtrx(unittest.TestCase):
|
||||||
"""Stop everything that was started."""
|
"""Stop everything that was started."""
|
||||||
rfxtrx_core.RECEIVED_EVT_SUBSCRIBERS = []
|
rfxtrx_core.RECEIVED_EVT_SUBSCRIBERS = []
|
||||||
rfxtrx_core.RFX_DEVICES = {}
|
rfxtrx_core.RFX_DEVICES = {}
|
||||||
|
if rfxtrx_core.RFXOBJECT:
|
||||||
|
rfxtrx_core.RFXOBJECT.close_connection()
|
||||||
self.hass.stop()
|
self.hass.stop()
|
||||||
|
|
||||||
def test_default_config(self):
|
def test_default_config(self):
|
||||||
|
|
|
@ -6,12 +6,9 @@ import time
|
||||||
from homeassistant.components import rfxtrx as rfxtrx
|
from homeassistant.components import rfxtrx as rfxtrx
|
||||||
from homeassistant.components.sensor import rfxtrx as rfxtrx_sensor
|
from homeassistant.components.sensor import rfxtrx as rfxtrx_sensor
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
from tests.common import get_test_home_assistant
|
from tests.common import get_test_home_assistant
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(True, reason='Does not clean up properly, takes 100% CPU')
|
|
||||||
class TestRFXTRX(unittest.TestCase):
|
class TestRFXTRX(unittest.TestCase):
|
||||||
"""Test the Rfxtrx component."""
|
"""Test the Rfxtrx component."""
|
||||||
|
|
||||||
|
@ -23,7 +20,8 @@ class TestRFXTRX(unittest.TestCase):
|
||||||
"""Stop everything that was started."""
|
"""Stop everything that was started."""
|
||||||
rfxtrx.RECEIVED_EVT_SUBSCRIBERS = []
|
rfxtrx.RECEIVED_EVT_SUBSCRIBERS = []
|
||||||
rfxtrx.RFX_DEVICES = {}
|
rfxtrx.RFX_DEVICES = {}
|
||||||
rfxtrx.RFXOBJECT = None
|
if rfxtrx.RFXOBJECT:
|
||||||
|
rfxtrx.RFXOBJECT.close_connection()
|
||||||
self.hass.stop()
|
self.hass.stop()
|
||||||
|
|
||||||
def test_default_config(self):
|
def test_default_config(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue