def test_methods(self):
        """Test is_on, turn_on, turn_off methods."""
        self.assertTrue(setup_component(self.hass, DOMAIN, {DOMAIN: {
            'test_1': None,
        }}))
        entity_id = 'input_boolean.test_1'

        self.assertFalse(
            is_on(self.hass, entity_id))

        turn_on(self.hass, entity_id)

        self.hass.block_till_done()

        self.assertTrue(
            is_on(self.hass, entity_id))

        turn_off(self.hass, entity_id)

        self.hass.block_till_done()

        self.assertFalse(
            is_on(self.hass, entity_id))

        toggle(self.hass, entity_id)

        self.hass.block_till_done()

        self.assertTrue(is_on(self.hass, entity_id))
示例#2
0
    def test_methods(self):
        """Test is_on, turn_on, turn_off methods."""
        self.assertTrue(
            setup_component(self.hass, DOMAIN, {DOMAIN: {
                'test_1': None,
            }}))
        entity_id = 'input_boolean.test_1'

        self.assertFalse(is_on(self.hass, entity_id))

        turn_on(self.hass, entity_id)

        self.hass.block_till_done()

        self.assertTrue(is_on(self.hass, entity_id))

        turn_off(self.hass, entity_id)

        self.hass.block_till_done()

        self.assertFalse(is_on(self.hass, entity_id))

        toggle(self.hass, entity_id)

        self.hass.block_till_done()

        self.assertTrue(is_on(self.hass, entity_id))
    def test_methods(self):
        """ Test is_on, turn_on, turn_off methods. """
        self.assertTrue(input_boolean.setup(self.hass, {
            'input_boolean': {
                'test_1': None,
            }
        }))
        entity_id = 'input_boolean.test_1'

        self.assertFalse(
            input_boolean.is_on(self.hass, entity_id))

        input_boolean.turn_on(self.hass, entity_id)

        self.hass.pool.block_till_done()

        self.assertTrue(
            input_boolean.is_on(self.hass, entity_id))

        input_boolean.turn_off(self.hass, entity_id)

        self.hass.pool.block_till_done()

        self.assertFalse(
            input_boolean.is_on(self.hass, entity_id))
示例#4
0
    def test_methods(self):
        """ Test is_on, turn_on, turn_off methods. """
        self.assertTrue(
            input_boolean.setup(self.hass,
                                {'input_boolean': {
                                    'test_1': None,
                                }}))
        entity_id = 'input_boolean.test_1'

        self.assertFalse(input_boolean.is_on(self.hass, entity_id))

        input_boolean.turn_on(self.hass, entity_id)

        self.hass.pool.block_till_done()

        self.assertTrue(input_boolean.is_on(self.hass, entity_id))

        input_boolean.turn_off(self.hass, entity_id)

        self.hass.pool.block_till_done()

        self.assertFalse(input_boolean.is_on(self.hass, entity_id))