def test_move_position(self): """Test moving the rollershutter to a specific position.""" entity = demo.DemoRollershutter(self.hass, 'test', 0) entity.move_position(10) fire_time_changed(self.hass, dt_util.utcnow()) self.hass.block_till_done() self.assertEqual(10, entity.current_position)
def test_move_up(self): """Test moving the rollershutter up.""" entity = demo.DemoRollershutter(self.hass, 'test', 100) entity.move_up() fire_time_changed(self.hass, dt_util.utcnow()) self.hass.block_till_done() self.assertEqual(90, entity.current_position)
def test_stop(self): """Test stopping the rollershutter.""" entity = demo.DemoRollershutter(self.hass, 'test', 0) entity.move_down() entity.stop() fire_time_changed(self.hass, dt_util.utcnow()) self.hass.block_till_done() self.assertEqual(0, entity.current_position)