Beispiel #1
0
    def test_status(self):
        self.device._reset_state()

        assert repr(self.state()) == repr(AirQualityMonitorStatus(self.device.start_state))

        assert self.is_on() is True
        assert self.state().aqi == self.device.start_state["aqi"]
        assert self.state().battery == self.device.start_state["battery"]
        assert self.state().usb_power is (self.device.start_state["usb_state"] == 'on')
        assert self.state().display_clock is (self.device.start_state["time_state"] == 'on')
        assert self.state().night_mode is (self.device.start_state["night_state"] == 'on')
Beispiel #2
0
    def test_status(self):
        self.device._reset_state()

        assert repr(self.state()) == repr(
            AirQualityMonitorStatus(self.device.start_state))

        assert self.is_on() is True
        assert self.state().aqi == self.device.start_state["aqi"]
        assert self.state().battery == self.device.start_state["battery"]
        assert self.state().usb_power == (
            self.device.start_state["usb_state"] == 'on')
        assert self.state().time_state == self.device.start_state["time_state"]
    def test_status(self):
        self.device._reset_state()

        assert repr(self.state()) == repr(
            AirQualityMonitorStatus(self.device.start_state))

        assert self.state().battery == self.device.start_state["battery"]
        assert self.state().co2 == self.device.start_state["co2"]
        assert self.state().humidity == self.device.start_state["humidity"]
        assert self.state().pm25 == self.device.start_state["pm25"]
        assert self.state(
        ).temperature == self.device.start_state["temperature"]
        assert self.state().tvoc == self.device.start_state["tvoc"]
        assert self.state().aqi is None
        assert self.state().usb_power is None
        assert self.state().display_clock is None
        assert self.state().night_mode is None