def test_setup_component(self):
        """Test setup component with devices."""
        def _add_device(devices):
            assert len(devices) == 1
            assert devices[0].name == "Device_name filter life"

        device = _get_device_without_state()
        self.hass.data[dyson.DYSON_DEVICES] = [device]
        dyson.setup_platform(self.hass, None, _add_device)
Exemple #2
0
    def test_setup_component(self):
        """Test setup component with devices."""
        def _add_device(devices):
            assert len(devices) == 1
            assert devices[0].name == "Device_name filter life"

        device = _get_device_without_state()
        self.hass.data[dyson.DYSON_DEVICES] = [device]
        dyson.setup_platform(self.hass, None, _add_device)
Exemple #3
0
    def test_setup_component(self):
        """Test setup component with devices."""
        def _add_device(devices):
            assert len(devices) == 5
            assert devices[0].name == "Device_name filter life"
            assert devices[1].name == "Device_name dust"
            assert devices[2].name == "Device_name humidity"
            assert devices[3].name == "Device_name temperature"
            assert devices[4].name == "Device_name air quality"

        device = _get_device_without_state()
        self.hass.data[dyson.DYSON_DEVICES] = [device]
        dyson.setup_platform(self.hass, None, _add_device)
Exemple #4
0
    def test_setup_component(self):
        """Test setup component with devices."""
        def _add_device(devices):
            assert len(devices) == 5
            assert devices[0].name == "Device_name filter life"
            assert devices[1].name == "Device_name dust"
            assert devices[2].name == "Device_name humidity"
            assert devices[3].name == "Device_name temperature"
            assert devices[4].name == "Device_name air quality"

        device = _get_device_without_state()
        self.hass.data[dyson.DYSON_DEVICES] = [device]
        dyson.setup_platform(self.hass, None, _add_device)
Exemple #5
0
    def test_setup_component(self):
        """Test setup component with devices."""
        def _add_device(devices):
            assert len(devices) == 5
            assert devices[0].name == "Device_name Filter Life"
            assert devices[1].name == "Device_name Dust"
            assert devices[2].name == "Device_name Humidity"
            assert devices[3].name == "Device_name Temperature"
            assert devices[4].name == "Device_name AQI"

        device_fan = _get_device_without_state()
        device_non_fan = _get_with_state()
        self.hass.data[dyson.DYSON_DEVICES] = [device_fan, device_non_fan]
        dyson.setup_platform(self.hass, None, _add_device)
    def test_setup_component(self):
        """Test setup component with devices."""
        def _add_device(devices):
            assert len(devices) == 5
            assert devices[0].name == "Device_name Filter Life"
            assert devices[1].name == "Device_name Dust"
            assert devices[2].name == "Device_name Humidity"
            assert devices[3].name == "Device_name Temperature"
            assert devices[4].name == "Device_name AQI"

        device_fan = _get_device_without_state()
        device_non_fan = _get_with_state()
        self.hass.data[dyson.DYSON_DEVICES] = [device_fan, device_non_fan]
        dyson.setup_platform(self.hass, None, _add_device)
Exemple #7
0
 def test_setup_component_with_no_devices(self):
     """Test setup component with no devices."""
     self.hass.data[dyson.DYSON_DEVICES] = []
     add_devices = mock.MagicMock()
     dyson.setup_platform(self.hass, None, add_devices)
     add_devices.assert_called_with([])
 def test_setup_component_with_no_devices(self):
     """Test setup component with no devices."""
     self.hass.data[dyson.DYSON_DEVICES] = []
     add_devices = mock.MagicMock()
     dyson.setup_platform(self.hass, None, add_devices)
     add_devices.assert_called_with([])