Beispiel #1
0
 def test_is_on_false(self, mock_update):
     """Check the return that _state is not the same as value_on."""
     sensor = bin_tcp.TcpBinarySensor(
         self.hass, test_tcp.TEST_CONFIG['sensor'])
     sensor._state = '{} abc'.format(
         test_tcp.TEST_CONFIG['sensor'][tcp.CONF_VALUE_ON])
     assert not sensor.is_on
Beispiel #2
0
 def test_is_on_true(self, mock_update):
     """Check the return that _state is value_on."""
     sensor = bin_tcp.TcpBinarySensor(
         self.hass, test_tcp.TEST_CONFIG['sensor'])
     sensor._state = test_tcp.TEST_CONFIG['sensor'][tcp.CONF_VALUE_ON]
     print(sensor._state)
     assert sensor.is_on