Esempio n. 1
0
    def test_setup_sensors(self):
        """Test the sensor setup."""
        online_device_at_home = mock_device(20, "Dining Room", True, "Canary")
        offline_device_at_home = mock_device(21, "Front Yard", False, "Canary")
        online_device_at_work = mock_device(22, "Office", True, "Canary")

        self.hass.data[DATA_CANARY] = Mock()
        self.hass.data[DATA_CANARY].locations = [
            mock_location("Home", True, devices=[online_device_at_home,
                                                 offline_device_at_home]),
            mock_location("Work", True, devices=[online_device_at_work]),
        ]

        canary.setup_platform(self.hass, self.config, self.add_entities, None)

        assert 6 == len(self.DEVICES)
Esempio n. 2
0
    def test_setup_sensors(self):
        """Test the sensor setup."""
        online_device_at_home = mock_device(20, "Dining Room", True, "Canary Pro")
        offline_device_at_home = mock_device(21, "Front Yard", False, "Canary Pro")
        online_device_at_work = mock_device(22, "Office", True, "Canary Pro")

        self.hass.data[DATA_CANARY] = Mock()
        self.hass.data[DATA_CANARY].locations = [
            mock_location(
                "Home", True, devices=[online_device_at_home, offline_device_at_home]
            ),
            mock_location("Work", True, devices=[online_device_at_work]),
        ]

        canary.setup_platform(self.hass, self.config, self.add_entities, None)

        assert len(self.DEVICES) == 6