Ejemplo n.º 1
0
    def test_toggle(self):
        """Test toggle method."""
        runs = []
        self.hass.services.register("light", SERVICE_TOGGLE, lambda x: runs.append(1))

        comps.toggle(self.hass, "light.Bowl")

        self.hass.pool.block_till_done()

        self.assertEqual(1, len(runs))
Ejemplo n.º 2
0
    def test_toggle(self):
        """Test toggle method."""
        runs = []
        self.hass.services.register('light', SERVICE_TOGGLE,
                                    lambda x: runs.append(1))

        comps.toggle(self.hass, 'light.Bowl')

        self.hass.pool.block_till_done()

        self.assertEqual(1, len(runs))
Ejemplo n.º 3
0
 def test_toggle(self):
     """Test toggle method."""
     calls = mock_service(self.hass, 'light', SERVICE_TOGGLE)
     comps.toggle(self.hass, 'light.Bowl')
     self.hass.block_till_done()
     self.assertEqual(1, len(calls))
Ejemplo n.º 4
0
 def test_toggle(self):
     """Test toggle method."""
     calls = mock_service(self.hass, 'light', SERVICE_TOGGLE)
     comps.toggle(self.hass, 'light.Bowl')
     self.hass.block_till_done()
     self.assertEqual(1, len(calls))