def test_state_value(self):
        with tempfile.TemporaryDirectory() as tempdirname:
            path = os.path.join(tempdirname, 'rollershutter_status')
            test_rollershutter = {
                'statecmd': 'cat {}'.format(path),
                'upcmd': 'echo 1 > {}'.format(path),
                'downcmd': 'echo 1 > {}'.format(path),
                'stopcmd': 'echo 0 > {}'.format(path),
                'value_template': '{{ value }}'
            }
            self.assertTrue(rollershutter.setup(self.hass, {
                'rollershutter': {
                    'platform': 'command_line',
                    'rollershutters': {
                        'test': test_rollershutter
                    }
                }
            }))

            state = self.hass.states.get('rollershutter.test')
            self.assertEqual('unknown', state.state)

            rollershutter.move_up(self.hass, 'rollershutter.test')
            self.hass.pool.block_till_done()

            state = self.hass.states.get('rollershutter.test')
            self.assertEqual('open', state.state)

            rollershutter.move_down(self.hass, 'rollershutter.test')
            self.hass.pool.block_till_done()

            state = self.hass.states.get('rollershutter.test')
            self.assertEqual('open', state.state)

            rollershutter.stop(self.hass, 'rollershutter.test')
            self.hass.pool.block_till_done()

            state = self.hass.states.get('rollershutter.test')
            self.assertEqual('closed', state.state)
Test with state value.
dataset/ETHPy150Open home-assistant/home-assistant/tests/components/rollershutter/test_command_line.py/TestCommandRollerShutter.test_state_value