예제 #1
0
 def test_dyson_air_quality_sensor_with_values(self):
     """Test air quality sensor with values."""
     sensor = dyson.DysonAirQualitySensor(self.hass, _get_with_state())
     sensor.entity_id = "sensor.dyson_1"
     self.assertFalse(sensor.should_poll)
     self.assertEqual(sensor.state, 2)
     self.assertEqual(sensor.unit_of_measurement, 'level')
     self.assertEqual(sensor.name, "Device_name air quality")
     self.assertEqual(sensor.entity_id, "sensor.dyson_1")
예제 #2
0
 def test_dyson_air_quality_sensor(self):
     """Test air quality sensor with no value."""
     sensor = dyson.DysonAirQualitySensor(_get_device_without_state())
     sensor.hass = self.hass
     sensor.entity_id = "sensor.dyson_1"
     self.assertFalse(sensor.should_poll)
     self.assertIsNone(sensor.state)
     self.assertEqual(sensor.unit_of_measurement, None)
     self.assertEqual(sensor.name, "Device_name AQI")
     self.assertEqual(sensor.entity_id, "sensor.dyson_1")
예제 #3
0
 def test_dyson_air_quality_sensor_with_values(self):
     """Test air quality sensor with values."""
     sensor = dyson.DysonAirQualitySensor(_get_with_state())
     sensor.hass = self.hass
     sensor.entity_id = "sensor.dyson_1"
     assert not sensor.should_poll
     assert sensor.state == 2
     assert sensor.unit_of_measurement is None
     assert sensor.name == "Device_name AQI"
     assert sensor.entity_id == "sensor.dyson_1"