Fixed statsd stopping if state is not numeric or only attributes changed (#3981)

* Fixed statsd stopping if attribute changed by not the state

* Fixed tests which exposed a new bug.

* Fixed another issue. whoops
This commit is contained in:
Brent Hughes authored and Paulus Schoutsen committed 2016-10-21 23:18:13 -07:00
1 parent 754d536974
commit 6e5a3c0a94
2 files changed
+13 -10

No files matched your search

+2 -2
View File
@@ -114,7 +114,7 @@ class TestStatsd(unittest.TestCase):
handler_method(mock.MagicMock(data={
'new_state': ha.State('domain.test', invalid, {})}))
self.assertFalse(mock_client.return_value.gauge.called)
self.assertFalse(mock_client.return_value.incr.called)
self.assertTrue(mock_client.return_value.incr.called)
@mock.patch('statsd.StatsClient')
def test_event_listener_attr_details(self, mock_client):
@@ -162,4 +162,4 @@ class TestStatsd(unittest.TestCase):
handler_method(mock.MagicMock(data={
'new_state': ha.State('domain.test', invalid, {})}))
self.assertFalse(mock_client.return_value.gauge.called)
self.assertFalse(mock_client.return_value.incr.called)
self.assertTrue(mock_client.return_value.incr.called)