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))
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))
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))