def test_dyson_humidity_sensor_with_values(self): """Test humidity sensor with values.""" sensor = dyson.DysonHumiditySensor(self.hass, _get_with_state()) sensor.entity_id = "sensor.dyson_1" self.assertFalse(sensor.should_poll) self.assertEqual(sensor.state, 45) self.assertEqual(sensor.unit_of_measurement, '%') self.assertEqual(sensor.name, "Device_name humidity") self.assertEqual(sensor.entity_id, "sensor.dyson_1")
def test_dyson_humidity_standby_monitoring(self): """Test humidity sensor while device is in standby monitoring.""" sensor = dyson.DysonHumiditySensor(_get_with_standby_monitoring()) sensor.hass = self.hass sensor.entity_id = "sensor.dyson_1" self.assertFalse(sensor.should_poll) self.assertEqual(sensor.state, STATE_OFF) self.assertEqual(sensor.unit_of_measurement, '%') self.assertEqual(sensor.name, "Device_name Humidity") self.assertEqual(sensor.entity_id, "sensor.dyson_1")
def test_dyson_humidity_standby_monitoring(self): """Test humidity sensor while device is in standby monitoring.""" sensor = dyson.DysonHumiditySensor(_get_with_standby_monitoring()) sensor.hass = self.hass sensor.entity_id = "sensor.dyson_1" assert not sensor.should_poll assert sensor.state == STATE_OFF assert sensor.unit_of_measurement == '%' assert sensor.name == "Device_name Humidity" assert sensor.entity_id == "sensor.dyson_1"
def test_dyson_humidity_sensor(self): """Test humidity sensor with no value.""" sensor = dyson.DysonHumiditySensor(_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, '%') self.assertEqual(sensor.name, "Device_name Humidity") self.assertEqual(sensor.entity_id, "sensor.dyson_1")
def test_dyson_humidity_sensor_with_values(self): """Test humidity sensor with values.""" sensor = dyson.DysonHumiditySensor(_get_with_state()) sensor.hass = self.hass sensor.entity_id = "sensor.dyson_1" assert not sensor.should_poll assert sensor.state == 45 assert sensor.unit_of_measurement == '%' assert sensor.name == "Device_name Humidity" assert sensor.entity_id == "sensor.dyson_1"