'Test with state value.'

def test_state_value(self):

    with tempfile.TemporaryDirectory() as tempdirname:
        path = os.path.join(tempdirname, 'cover_status')
        test_cover = {'command_state': 'cat    {}'.format(path), 'command_open': 'echo    1    >    {}'.format(path), 'command_close': 'echo    1    >    {}'.format(path), 'command_stop': 'echo    0    >    {}'.format(path), 'value_template': '{{    value    }}'}
        self.assertTrue(setup_component(self.hass, cover.DOMAIN, {'cover': {'platform': 'command_line', 'covers': {'test': test_cover}}}))
        state = self.hass.states.get('cover.test')
        self.assertEqual('unknown', state.state)
        cover.open_cover(self.hass, 'cover.test')
        self.hass.block_till_done()
        state = self.hass.states.get('cover.test')
        self.assertEqual('open', state.state)
        cover.close_cover(self.hass, 'cover.test')
        self.hass.block_till_done()
        state = self.hass.states.get('cover.test')
        self.assertEqual('open', state.state)
        cover.stop_cover(self.hass, 'cover.test')
        self.hass.block_till_done()
        state = self.hass.states.get('cover.test')
        self.assertEqual('closed', state.state)
